-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Flake in test_decompose_to_diagonal_and_circuit #5574
Labels
area/ci
area/decompose
area/testing
kind/bug-report
Something doesn't seem to work.
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
Comments
xref #5533 |
|
viathor
added
area/testing
area/decompose
area/ci
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
labels
Jun 24, 2022
We have rolled back the change in default #5636 so these should no longer be occurring |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/ci
area/decompose
area/testing
kind/bug-report
Something doesn't seem to work.
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
v = array([[-0.61070603+0.1365783j , -0.5391698 -0.27113172j, -0.13448845+0.33649975j, 0.07048975+0.3284511j ],
[-...[-0.144254 +0.16332075j, 0.23525491+0.0989278j , -0.29602534+0.62655133j, -0.28742015-0.56971717j]], dtype=complex64)
@pytest.mark.parametrize(
"v",
[
cirq.unitary(random_two_qubit_circuit_with_czs(3)),
cirq.unitary(random_two_qubit_circuit_with_czs(2)),
np.diag(np.exp(1j * np.pi * np.random.random(4))),
],
)
deftest_decompose_to_diagonal_and_circuit(v):
b, c = cirq.LineQubit.range(2)
diagonal, ops = two_qubit_matrix_to_diagonal_and_cz_operations(b, c, v, atol=1e-6)
assert cirq.is_diagonal(diagonal)
combined_circuit = cirq.Circuit(cirq.MatrixGate(diagonal)(b, c), ops)
circuit_unitary = combined_circuit.unitary(qubits_that_should_be_present=[b, c])
E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=1e-05
E
E Mismatched elements: 16 / 16 (100%)
E Max absolute difference: 6.1219725e-05
E Max relative difference: 0.00010682
E x: array([[ 0.384335+4.938793e-01j, -0.014804+6.033021e-01j, 0.361728-2.215727e-02j, 0.266857-2.040258e-01j],
E [ 0.619436-1.967203e-01j, -0.672573-1.093492e-01j, -0.196227+1.505381e-01j, -0.16237 -1.604927e-01j],
E [-0.215903+3.031191e-01j, -0.21768 +2.428720e-01j, -0.19194 -5.389726e-01j, -0.650181-7.116976e-02j],
E [ 0.209275+6.065131e-02j, -0.011074-2.549549e-01j, 0.692938-5.960464e-08j, -0.392396+5.032529e-01j]], dtype=complex64)
E y: array([[ 0.384375+4.938332e-01j, -0.014821+6.033215e-01j, 0.361702-2.214911e-02j, 0.266861-2.040445e-01j],
E [ 0.619446-1.967466e-01j, -0.672537-1.093988e-01j, -0.196237+1.505618e-01j, -0.162392-1.604833e-01j],
E [-0.215881+3.031079e-01j, -0.217704+2.428641e-01j, -0.191879-5.389693e-01j, -0.650208-7.117966e-02j],
E [ 0.209292+6.066049e-02j, -0.011051-2.549695e-01j, 0.692963+5.960464e-08j, -0.392335+5.032508e-01j]], dtype=complex64)
cirq-core/cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py:268: AssertionError
The text was updated successfully, but these errors were encountered: