Skip to content

Conversation

@tcochran-quera
Copy link
Collaborator

To simulate some operations, for example multiple rounds of syndrome extraction, it is useful to be able to measure and reuse the measurement qubits in the cirq simulation to save on RAM (even if on Gemini we will actually use different measurement atoms for each round of syndrome extraction).

Here is a minimum fix to allow for measurement and reset gates in the noise models. The next step would be to add error in the measurement that is proportional to the number of gate operations left in the circuit, since in Gemini we will have to wait until the end of the circuit to measure any atom.

@david-pl what do you think is the right course of action?

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bloqade/cirq_utils/noise/model.py 76.92% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
9504 8383 88% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/bloqade/cirq_utils/noise/model.py 89% 🟢
TOTAL 89% 🟢

updated for commit: 419233b by action🐍


gate = operation.gate
for allowed_family in allowed_target_gates:
for allowed_family in set(allowed_target_gates).union({cirq.GateFamily(gate=cirq.ops.common_channels.ResetChannel, ignore_global_phase=True)}):
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can just add that to the allowed gates with e.g.

reset_family = cirq.GateFamily(gate=cirq.ResetChannel, ignore_global_phase=True)
allowed_target_gates: frozenset[cirq.GateFamily] = cirq.CZTargetGateset(additional_gates=[reset_family]).gates

Your approach here works as well though.

@david-pl
Copy link
Collaborator

@tcochran-quera This looks like a good approach here. Could you also add a unit test?

Regarding adding errors: do we know the length of remaining operations? Or does that mean we'd have to iterate over the entire circuit another time?

@tcochran-quera
Copy link
Collaborator Author

@tcochran-quera This looks like a good approach here. Could you also add a unit test?

Regarding adding errors: do we know the length of remaining operations? Or does that mean we'd have to iterate over the entire circuit another time?

Probably we could have something reasonable that wouldn't require looping over the entire circuit for each measurement moment. I'll play with it some when i get the chance.

@david-pl
Copy link
Collaborator

I'll play with it some when i get the chance.

@tcochran-quera cool! In the meantime, would you want to have this change merged in?

@tcochran-quera
Copy link
Collaborator Author

tcochran-quera commented Oct 29, 2025

I'll play with it some when i get the chance.

@tcochran-quera cool! In the meantime, would you want to have this change merged in?

I'm okay waiting until this is finalized before we merge, but I don't feel strongly about it.

@tcochran-quera tcochran-quera self-assigned this Oct 29, 2025
@david-pl
Copy link
Collaborator

I'm okay waiting until this is finalized before we merge, but I don't feel strongly about it.

I see. Well, since there's a lot of changes going in right now, it might make sense not to rush this one here. I'll just wait until you ping me again.

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