- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
正如标题所说,如何在 Q# 中实现 Grover 的扩散算子?我知道它被定义为 2 ⟨s|s⟩ - I
哪里|s⟩
是任意数量的量子比特的统一状态。这可以进一步定义为夹在一对 H 门之间的 Z0(看到它称为 U0)门。我无法在量子原语和规范文档中找到任何以 Grover、diff 等可能名称开头的函数。
我不想使用功能 AmpAmpByOracle
因为它是非常高级的实现并且没有清除我的理解。我想实现一个函数,它需要一个 oracle Uf(我认为未知)和它需要的量子比特数(N),并通过简单地遵循 Grover's Algorithm | Wikipedia 中给出的电路来执行 Grover 算法。并通过在 r = approx(2^(N/2)) 迭代结束时测量所有 N 个量子位来测量所需的状态。
最佳答案
扩散操作有点棘手。我发现将它分解成碎片最容易:
// register is the Qubit[] that we want to apply the diffusion operation to
using (ancillae = Qubit[1])
{
let ancilla = ancillae[0];
X(ancilla); // Puts the ancilla into the |1> state
H(ancilla); // And now into the |-> state
ApplyToEach(H, register); // Put the register qubits into the X basis
ApplyToEach(X, register); // Flip 0->1 and 1->0
(Controlled X)(register, ancilla); // Do the controlled flip of the ancilla
ApplyToEach(X, register); // Undo the flip
ApplyToEach(H, register); // Undo the basis change
H(ancilla); // Put the ancilla back into |1>
X(ancilla); // And back to |0> so we can return it
}
关于quantum-computing - Q#中如何实现格罗弗扩散算子?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51190773/
我有一个状态|Q>的n位并想要测量位数 i 。是否有一个矩阵可以应用于状态,所以状态 Q最终为Q' ,比如 Hadamard 或 X 门? 或者我应该应用测量矩阵 |x>
我的 Firefox 刚刚更新到 Quantum,看起来用户代理不正确。现在是: Mozilla/5.0(Windows;U;Windows NT 5.0;rv:1.8.0.3)Gecko/20060
我有一个状态|Q>的n位并想要测量位数 i 。是否有一个矩阵可以应用于状态,所以状态 Q最终为Q' ,比如 Hadamard 或 X 门? 或者我应该应用测量矩阵 |x>
我正试图开始研究量子处理和量子算法,有什么资源可以从中获得这方面的知识? 有推荐的SDK吗? 有在线环境吗?(IBM也许会提供一个真正的量子处理器?) 在量子计算环境中,Hello World!会是什
正如标题所说,如何在 Q# 中实现 Grover 的扩散算子?我知道它被定义为 2 ⟨s|s⟩ - I哪里|s⟩是任意数量的量子比特的统一状态。这可以进一步定义为夹在一对 H 门之间的 Z0(看到它称
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 2 年前。 Improve t
在 Chrome 和 Firefox 中 const myWorker = new SharedWorker( "sharedWorkerChat.js" ); const port
我正在编写一个网站,该网站在 Bootstrap 4 之上使用了丰富的 Material Design 主题。到目前为止,我已经能够使所有浏览器 chrome 至少在某种程度上与该网站匹配(Chrom
今天,我将我的 Firefox 浏览器更新为 Firefox Quantum。但是当我想调试我的网络应用程序时,开发工具字体非常小。有什么办法可以调整吗??? firefox dev tool fon
我注意到新的 Firefox Quantum 上的动画有问题。 当您第一次加载包含一些动画元素 display: none; 的页面时,当脚本将其切换为 .display = "block"; 时,您
我想根据以下矩阵制作一个量子电路。 matrix to be transformed into qubit operations如何将此矩阵分解为 Rotation Y、Control-NOT 等量子
我刚刚安装了 Kony Studio 。我尝试在 Android 模拟器上运行 HelloWorld 应用程序,总是出现此错误: Failurerm failed for /sdcard/profil
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7 个月前关闭。 Improve t
当我深入研究所有可用文献时,我一遍又一遍地阅读,在量子计算中,最小的值(value)单位——量子比特——必须保持“ secret ”或未知,直到它被测量为止。在 StackOverflow 中,我什至
我正在使用适用于 Python 的 Microsoft Quantum Development Kit。我可以在真正的量子计算机上运行代码吗? 感谢您的回答。 最佳答案 本周早些时候,我们有 anno
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 11 个月前关闭。 Improve this que
我多久可以得到一台量子计算机?有什么方法可以建立一个简单的吗?对于早期采用者来说,它们还有多少年? 我想从高层次上了解 QBit 是什么,它可以有多少状态,以及哪些类型的算法可以在这个领域很好地工作。
是否可以使用不超过 2 个 Toffoli 门来实现或门? 我已经使用 3 个 Toffoli 门实现了它,但是找不到任何方法来使用 2 个 Toffoli 门实现它。 最佳答案 我假设您指的是两个量
是否可以使用不超过 2 个 Toffoli 门来实现或门? 我已经使用 3 个 Toffoli 门实现了它,但是找不到任何方法来使用 2 个 Toffoli 门实现它。 最佳答案 我假设您指的是两个量
我正在尝试在 Win 7 上通过 SSLKEYLOGFILE(将其放入 Wireshark)从 Firefox Quantum SSL 通信中提取预主 key ,如描述的那样在 https://www
我是一名优秀的程序员,十分优秀!