Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch issues of the crz #118

Closed
DevelopDaily opened this issue Dec 20, 2021 · 4 comments
Closed

Mismatch issues of the crz #118

DevelopDaily opened this issue Dec 20, 2021 · 4 comments

Comments

@DevelopDaily
Copy link

These issues may be related to both qpp #117 and the staq softwareQinc/staq#43, which fixed the state distortion problem by crz and may have introduced some new issues(?)

Here is a test script:

OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];

x q;
crz(1) q[0], q[1];

Qiskit produces the final state:

[ 0+0j, 0+0j, 0+0j, 0.878+0.479j ]

qpp:

0 0 0 0.540302 + 0.841471i

The crz is not documented in https://github.com/softwareQinc/qpp/blob/main/DISCREPANCIES.md.

@525125
Copy link
Contributor

525125 commented Dec 20, 2021

Continuing from #117 (comment):

Since rz and u1 are identical, it only makes sense for crz and cu1 to be identical as well (and they were made the same when fixing crz). This ensures that CRZ = CTRL-diag(RZ).

This is also related to #99

@DevelopDaily
Copy link
Author

Mimicking the tests in the issue #117, I did four tests to show the final states out of crz and cu1 on QISKIT and qpp.

In QISKIT:

x q;
crz(pi/3) q[0], q[1];
// => [ 0+0j, 0+0j, 0+0j, 0.866+0.5j ]
x q;
cu1(pi/3) q[0], q[1];
// => [ 0+0j, 0+0j, 0+0j, 0.5+0.866j ]

In qpp:

x q;
crz(pi/3) q[0], q[1];
// => 0  0  0  0.5 + 0.866025i
x q;
cu1(pi/3) q[0], q[1];
// => 0  0  0  0.5 + 0.866025i

The same problem, as expected, exists.

@vsoftco
Copy link
Member

vsoftco commented Jan 11, 2022

@DevelopDaily can you check this now please?

@DevelopDaily
Copy link
Author

Passed the simple test cases. Will test more complex cases in the #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants