如何产生纠缠、叠加和干涉?

问题描述

我正在寻找方式如何创建纠缠、叠加和干涉?有人可以帮助展示如何在 qiskit 中编码吗?以及与上述这些相关的文档?

谢谢

解决方法

给你

from qiskit import *  # importing qiskit
# instead of importing everything you could import things separately

def circ_superposition(number):

    # raising errors
    try:
        number = int(number)
    except:
        return "Number must be an integer"
    circ = QuantumCircuit(number,number)  # creating the circuit

    for i in range(number):
        circ.h(i)

    return circ

您可能想使用以下内容查看电路

print(f'{circ_superposition(6)}') # add any integer in place of 6

要创建纠缠,请执行以下操作

entanglement = QuantumCircuit(n,n)  # replace n by any integer
# apply h gates the qubits
for i in range(n): # replace n by any integer
    entanglment.h(i)
# apply cx gate
entanglement.cx(control,target) # replace control and target by control qubit and target qubit respectively 

来自进一步的帮助是指: Circuit Basics 还有Getting Stared With Qiskit

还可以考虑访问: Super Dense CodingQuantum Teleportation 用于量子干涉应用。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...