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

convert cliffords to xz in qubit characterization #6420

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Conversation

NoureldinYosri
Copy link
Collaborator

No description provided.

@NoureldinYosri NoureldinYosri marked this pull request as ready for review January 19, 2024 01:00
@NoureldinYosri NoureldinYosri requested review from mrwojtek, vtomole, cduck and a team as code owners January 19, 2024 01:00
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a3eed6b) 97.81% compared to head (9e28358) 97.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6420   +/-   ##
=======================================
  Coverage   97.81%   97.81%           
=======================================
  Files        1111     1111           
  Lines       97115    97121    +6     
=======================================
+ Hits        94994    95000    +6     
  Misses       2121     2121           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gate_ids = list(np.random.choice(clifford_group_size, num_cfds))
adjoint = _reduce_gate_seq([gate for gate_id in gate_ids for gate in cfds[gate_id]]) ** -1
return [op for gate_id in gate_ids for op in operations[gate_id]] + [adjoint(qubit)]
return [op for gate_id in gate_ids for op in operations[gate_id]] + [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that this didn't cause any unit tests to fail.

Can you add a test that validates the generated circuit(s) against a known gateset that resembles what we've already published via the Virtual Quantum Engine? e.g., you might check against a ValidatingTestDevice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's because none of the test examin the internals of the circuits but treat the circuits as blackboxes with a specific behaviour => it checks things like pauli errors and other characterisitics.

added a test for now

@NoureldinYosri NoureldinYosri enabled auto-merge (squash) January 19, 2024 02:05
Copy link
Collaborator

@wcourtney wcourtney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Just to confirm - the test fails w/o your code change, right?

@NoureldinYosri
Copy link
Collaborator Author

@wcourtney yes

    raise ValueError(f"Unsupported gate type: {operation.gate!r}")
ValueError: Unsupported gate type: cirq.CliffordGate.from_clifford_tableau(cirq.CliffordTableau(1,rs=np.array([False, False], dtype=np.dtype('bool')), xs=np.array([[True], [False]], dtype=np.dtype('bool')),zs=np.array([[False], [True]], dtype=np.dtype('bool')), initial_state=0))

@NoureldinYosri NoureldinYosri merged commit 91c3f45 into main Jan 19, 2024
38 checks passed
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
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

Successfully merging this pull request may close these issues.

3 participants