Intel® Quantum SDK
Forum related to Intel Quantum SDK, a full-stack software kit for programming and executing algorithms on simulated quantum hardware.
35 Discussions

The Amplitude for this state isn't what I expected. What gives?

KevinR_Intel
Moderator
980 Views

I'm adding a question here that came from a user in another communications channel:

When we run a simple [1-qubit] circuit that consists of the |0> state input into a single X gate, [such as]

PrepZ(my_qubit);
X(my_qubit);

we get the following output

Printing amplitude register of size 2

|0>     : (0,0)                         |1>     : (0,-1) 

The |0> state looks fine for a bit flip but shouldn’t the |1> state be (1,0) ? It appears that the output is multiplied by -j.

0 Kudos
1 Solution
KevinR_Intel
Moderator
977 Views

Basically, this is the consequence of the compiler being designed to compute in terms of the gate set for quantum dot qubits. The decomposition of X into the native gates gives a different, but physically equivalent, global phase than we might write doing the math by hand (where we implicitly assume our qubits directly support the gates in the textbook). The global phase will have no effect on observables; i.e., the probability is still guaranteed to be computed correctly.

If you inspect the .qs file produced during compilation, you will find the specific instructions executed

qurotxy QUBIT[0], 3.141593e+00, 0.000000e+00

Which is saying that the qurotxy quantum dot qubit gate (chapter 17 of the Guide and Reference) was applied to the 0th qubit and the parameters given to the gate were Pi and 0. The matrix elements of this gate are given in chapter 18,

Rxy(theta,phi) = cos(phi/2)                                -i*sin(theta/2)*(cos(phi) – i*sin(phi)
-i*sin(theta/2)*(cos(phi) + i*sin(phi)) cos(theta/2)

and substituting in Pi and 0, we find

X = Rxy(Pi, 0) =  0 -i or -i * 0 1
-i 0 1 0

So the -i can be factored out as a global phase (which can be ignored).

 

View solution in original post

1 Reply
KevinR_Intel
Moderator
978 Views

Basically, this is the consequence of the compiler being designed to compute in terms of the gate set for quantum dot qubits. The decomposition of X into the native gates gives a different, but physically equivalent, global phase than we might write doing the math by hand (where we implicitly assume our qubits directly support the gates in the textbook). The global phase will have no effect on observables; i.e., the probability is still guaranteed to be computed correctly.

If you inspect the .qs file produced during compilation, you will find the specific instructions executed

qurotxy QUBIT[0], 3.141593e+00, 0.000000e+00

Which is saying that the qurotxy quantum dot qubit gate (chapter 17 of the Guide and Reference) was applied to the 0th qubit and the parameters given to the gate were Pi and 0. The matrix elements of this gate are given in chapter 18,

Rxy(theta,phi) = cos(phi/2)                                -i*sin(theta/2)*(cos(phi) – i*sin(phi)
-i*sin(theta/2)*(cos(phi) + i*sin(phi)) cos(theta/2)

and substituting in Pi and 0, we find

X = Rxy(Pi, 0) =  0 -i or -i * 0 1
-i 0 1 0

So the -i can be factored out as a global phase (which can be ignored).

 

Reply