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

Fix cirq-to-stim conversion not adding TICKs for multi-moment single-rep CircuitOperations #728

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

AlexBourassa
Copy link
Collaborator

@AlexBourassa AlexBourassa commented Mar 21, 2024

Currently in main when we convert a cirq circuit to stim with a CircuitOperation with a single repetition (or with flatten=True) no TICK instructions are inserted since the moments are removed in the cirq.decompose_once(op) command.

@AlexBourassa AlexBourassa requested a review from Strilanc March 21, 2024 17:53
@Strilanc
Copy link
Collaborator

Can you give an example of a current bad output in the description of the PR?

@AlexBourassa
Copy link
Collaborator Author

Can you give an example of a current bad output in the description of the PR?

On main, the stim circuit from the unit test would be:

H 0 0 0 0
TICK

Whereas after this PR the output circuit is

H 0
TICK
H 0
TICK
H 0
TICK
H 0
TICK

@AlexBourassa AlexBourassa requested a review from Strilanc March 23, 2024 04:48
@AlexBourassa
Copy link
Collaborator Author

@Strilanc I think this should be ready to go! (although some of the CI are failing, but I don't think this is related to my change?). Please take another look when you get a chance!

@Strilanc
Copy link
Collaborator

It was failing because you were using cirq.q which doesn't exist in the cirq version the tests install, to ensure backwards compatibility.

@Strilanc Strilanc enabled auto-merge (squash) March 26, 2024 00:44
@Strilanc Strilanc disabled auto-merge March 26, 2024 00:44
@Strilanc Strilanc enabled auto-merge (squash) March 26, 2024 00:44
@Strilanc Strilanc changed the title Fix the TICK in cirq to stim conversion when there is only one rep or flatten is True Fix cirq-to-stim conversion not adding TICK for multi-moment single-rep CircuitOperations Mar 26, 2024
@Strilanc Strilanc changed the title Fix cirq-to-stim conversion not adding TICK for multi-moment single-rep CircuitOperations Fix cirq-to-stim conversion not adding TICKs for multi-moment single-rep CircuitOperations Mar 26, 2024
@Strilanc Strilanc disabled auto-merge March 26, 2024 00:45
@Strilanc Strilanc enabled auto-merge (squash) March 26, 2024 00:45
@Strilanc Strilanc merged commit bc638e3 into main Mar 26, 2024
54 checks passed
@Strilanc Strilanc deleted the u/ab/fix_no_ticks_in_circuit_ops branch March 26, 2024 01:05
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.

2 participants