Skip to content

Flake in test_decompose_two_qubit_interaction_into_two_b_gates #5590

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

Closed
dabacon opened this issue Jun 23, 2022 · 1 comment
Closed

Flake in test_decompose_two_qubit_interaction_into_two_b_gates #5590

dabacon opened this issue Jun 23, 2022 · 1 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

Comments

@dabacon
Copy link
Collaborator

dabacon commented Jun 23, 2022

The B in B gates stands for Birgitta.

_________ test_decompose_two_qubit_interaction_into_two_b_gates[obj12] _________
E         
E         obj = array([[-0.47694111+0.3915538j ,  0.21538306-0.31932923j,  0.27730114+0.04291081j,  0.59341889-0.19992136j],
E                [-...020922j],
E                [-0.40503864-0.31686381j, -0.72468644-0.40730777j, -0.133941  -0.14667923j,  0.02313404+0.06693884j]])
E         
E             @pytest.mark.parametrize('obj', UNITARY_OBJS)
E             def test_decompose_two_qubit_interaction_into_two_b_gates(obj: Any):
E                 circuit = cirq.Circuit(
E                     _decompose_two_qubit_interaction_into_two_b_gates(obj, qubits=cirq.LineQubit.range(2))
E                 )
E                 desired_unitary = obj if isinstance(obj, np.ndarray) else cirq.unitary(obj)
E                 for operation in circuit.all_operations():
E                     assert len(operation.qubits) < 2 or operation.gate == _B
E                 # We lose a lot of precision in the random 4 qubit gates, so this atol is higher.
E         >       np.testing.assert_allclose(cirq.unitary(circuit), desired_unitary, atol=1e-4)
E         E       AssertionError: 
E         E       Not equal to tolerance rtol=1e-07, atol=0.0001
E         E       
E         E       Mismatched elements: 10 / 16 (62.5%)
E         E       Max absolute difference: 0.00018732
E         E       Max relative difference: 0.00127372
E         E        x: array([[-0.477021+0.391513j,  0.215471-0.319221j,  0.277158+0.042791j,  0.59349 -0.199902j],
E         E              [-0.057516-0.529415j,  0.070736+0.385185j,  0.160235-0.451876j,  0.27052 -0.509895j],
E         E              [-0.24258 -0.110741j, -0.073792+0.042676j,  0.736175+0.331731j, -0.493886-0.160323j],
E         E              [-0.405093-0.316814j, -0.724758-0.407135j, -0.133913-0.146816j,  0.023186+0.066865j]], dtype=complex64)
E         E        y: array([[-0.476941+0.391554j,  0.21[538](https://github.com/quantumlib/Cirq/runs/7031790758?check_suite_focus=true#step:5:539)3-0.319329j,  0.277301+0.042911j,  0.593419-0.199921j],
E         E              [-0.057643-0.529477j,  0.070664+0.385111j,  0.160224-0.45184j ,  0.270658-0.509843j],
E         E              [-0.242481-0.110851j, -0.073766+0.042702j,  0.736204+0.331632j, -0.49397 -0.160209j],
E         E              [-0.405039-0.316864j, -0.724686-0.407308j, -0.133941-0.146679j,  0.023134+0.066939j]])
@dabacon dabacon added the kind/bug-report Something doesn't seem to work. label Jun 23, 2022
@viathor viathor added area/decompose area/ci area/testing triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on labels Jun 24, 2022
@dabacon
Copy link
Collaborator Author

dabacon commented Jun 29, 2022

We have rolled back the change in default #5636 so these should no longer be occurring

@dabacon dabacon closed this as completed Jun 29, 2022
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
Projects
None yet
Development

No branches or pull requests

2 participants