Quirk 是一款玩具量子电路模拟器,旨在帮助人们学习量子计算。
如果您想快速探索小型量子电路的行为,Quirk 就是适合您的工具。无需安装、配置或编写脚本:只需访问algassert.com/quirk,将门拖到电路上,输出显示就会实时更新。
(如果您仍然想了解量子电路是什么,那么我推荐视频系列“量子计算”。Quirk 假设您已经知道“每根线代表一个量子位”等背景事实。)
定义特征:
- 在网络浏览器中运行。
- 拖放电路编辑。
- 实时反应、模拟和动画。
- 内联状态显示。
- 可添加书签/可链接的电路。
- 最多 16 个量子位。
值得注意的限制:
- 无法重新连贯测量的量子位(因为测量是基于延迟测量原理的黑客实现的)。
试试看:
Basic usage demo:
Grover search circuit with chance and sample displays (showing that the chance of success increases):
Quantum teleportation circuit with Bloch sphere displays (showing that the qubit at the top has ended up at the bottom):
如果您想修改 Quirk,可以通过以下方式获取代码并将更改转换为可用的 html/javascript。
-
sudo add-apt-repository universesudo apt-get updatesudo apt-get install --yes git npm nodejs-legacy -
克隆存储库。
git clone https://github.com/Strilanc/Quirk.git -
安装开发依赖项。
cd Quirknpm install -
(可选)进行更改。运行测试。
npm run test-firefox -
构建输出。
npm run build -
out/quirk.html通过使用 Web 浏览器打开来确认输出是否有效。firefox out/quirk.html -
复制
out/quirk.html到你想要的任何地方。
Quirk 不是 Google 官方产品。