4
$\begingroup$

I tried to implement the following circuit in the image below but with the red circled gates replaced with a unitary controlled ${e^{iAt/2}}$ and controlled ${e^{iAt/4}}$ enter image description here The image came from this paper here and someone already implemented this circuit here.

The matrix A is :
enter image description here
And t = 2π

For ${e^{iAt/2}}$ I found that the matrix is equal to an X gate which is same as the paper. enter image description here

For ${e^{iAt/4}}$ I got this matrix.
enter image description here
But in the paper they use U3(-pi/2,-pi/2,pi/2) as target bit and U1(3π/4) afterwards at control bit.
The unitary matrix from both qubit is something like this.(I use qiskit to find the unitary matrix)
enter image description here

While my ${e^{iAt/4}}$ connected with a control bit gives different unitary matrix. enter image description here
Am I missing something or is there anything wrong with my ${e^{iAt/4}}$ unitary?

$\endgroup$
3
$\begingroup$

The mistakes comes from the fact that you missed the controlled-part of the U3 gate.

So your equivalent gate should really be:

qr = QuantumRegister(2, 'qubit')
qc = QuantumCircuit(qr, ClassicalRegister(2, name='classicabit'))
qc.cu3(-math.pi/2, -math.pi/2, math.pi/2, 0, 1)
qc.u1(3.0*math.pi/4,0)

The unitary result of :
enter image description here

is :

[[ 1. +0.j   0. +0.j   0. +0.j   0. +0.j ]  
 [ 0. +0.j  -0.5+0.5j  0. +0.j  -0.5-0.5j]  
 [ 0. +0.j   0. +0.j   1. +0.j   0. +0.j ]  
 [ 0. +0.j  -0.5-0.5j  0. +0.j  -0.5+0.5j]]  

Where you find your unitary matrix :

[[ -0.5+0.5j -0.5-0.5j]
[ -0.5-0.5j -0.5+0.5j]]

controlled by qubit 1.

I did not understand how you implemented your ${e^{iAt/4}}$ controlled gate, at least the methods you use do not work with my qiskit version so you can check with this code :

A = np.array([[1.5, 0.5],[0.5, 1.5]])
qc = QuantumCircuit(2)
gate=ex.UnitaryGate(expm(A*1.j*math.pi/2)).control(1)
qc.append(gate, [0,1])

qasm_sim = BasicAer.get_backend('unitary_simulator')
result = execute(qc, qasm_sim).result()
print(result.get_unitary())

enter image description here

which produces

[[ 1. -5.55111512e-17j 0. +0.00000000e+00j 0. +0.00000000e+00j 0.+0.00000000e+00j]
[ 0. +0.00000000e+00j -0.5+5.00000000e-01j 0. +0.00000000e+00j -0.5-5.00000000e-01j] [ 0. +0.00000000e+00j 0. +0.00000000e+00j 1. -7.21644966e-16j 0. +0.00000000e+00j] [ 0. +0.00000000e+00j -0.5-5.00000000e-01j 0. +0.00000000e+00j -0.5+5.00000000e-01j]]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.