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

Use Cirq Transforms for Gate Decomposition (#93) #184

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

arulandu
Copy link

@arulandu arulandu commented Nov 11, 2024

Summary of changes

Use optimize_for_target_gateset instead of the naive cirq.decompose_once when decomposing circuits to a given gateset. Closes #93.

@arulandu arulandu changed the title Cirq Decompose (#93) [Draft] Use Cirq Transforms for Gate Decomposition (#93) Dec 13, 2024
@@ -40,17 +95,17 @@ def test_convert_gridqubits_to_linequbits(gridqubit_circuit):
linequbit_circuit = preprocess_circuit(gridqubit_circuit)
for qubit in linequbit_circuit.all_qubits():
assert isinstance(qubit, cirq.LineQubit), "Qubit is not a LineQubit"
assert np.allclose(
linequbit_circuit.unitary(), gridqubit_circuit.unitary()
_assert_allclose_up_to_global_phase(
Copy link
Member

Choose a reason for hiding this comment

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

qbraid is already a test dependency so you can just use qbraid.interface.assert_allclose_up_to_global_phase instead of copying over those same funcs

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.

Cirq decompose to supported gate set
2 participants