Exemple #1
0
def _qcircuit_4qubit_entanglement(theta_aux):
    C = QCircuit(4)
    for l in range(theta_aux.shape[1] - 1):
        for q in range(theta_aux.shape[0]):
            C.U3(q, theta_aux[q,l,:])
        if l%2 == 0:
            C.Cz(0,1)
            C.Cz(2,3)
        elif l%2 == 1:
            C.Cz(1,2)
            C.Cz(0,3)
    for q in range(theta_aux.shape[0]):
        C.U3(q, theta_aux[q,-1,:])
    return C
Exemple #2
0
def _qcircuit_2qubit_entanglement(theta_aux):
    C = QCircuit(2)
    for l in range(theta_aux.shape[1] - 1):
        for q in range(theta_aux.shape[0]):
            C.U3(q, theta_aux[q,l,:])
        C.Cz(0,1)
    for q in range(theta_aux.shape[0]):
        C.U3(q, theta_aux[q,-1,:])
    return C