【问题标题】:How to create Entanglement, Superposition and interference?如何产生纠缠、叠加和干涉?
【发布时间】:2021-04-11 08:44:01
【问题描述】:

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

谢谢

【问题讨论】:

    标签: python algorithm temenos-quantum qiskit


    【解决方案1】:

    给你

    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 用于量子干涉的应用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-26
      • 1970-01-01
      • 1970-01-01
      • 2018-09-02
      • 2015-02-10
      • 2020-09-12
      相关资源
      最近更新 更多