Skip to content

Ancilla qubit allocation in LogicalCircuit via AncillaReservoir#18

Open
NolanHeffner wants to merge 14 commits intomainfrom
ancilla_reservoir
Open

Ancilla qubit allocation in LogicalCircuit via AncillaReservoir#18
NolanHeffner wants to merge 14 commits intomainfrom
ancilla_reservoir

Conversation

@NolanHeffner
Copy link
Copy Markdown
Collaborator

No description provided.

@NolanHeffner NolanHeffner self-assigned this Nov 9, 2025
@RasmitDevkota
Copy link
Copy Markdown
Member

Thanks for working on this, could you summarize any tests you performed besides whatever is contained in the demo notebook? I will probably go through and do my own round of testing (including hardware compatibility), but it would be nice to know what's already been checked.

@RasmitDevkota RasmitDevkota changed the title Merging refactor of LogicalCircuit to use ancilla reservoirs. Ancilla qubit allocation in LogicalCircuit via AncillaReservoir Nov 9, 2025
@RasmitDevkota RasmitDevkota self-assigned this Nov 9, 2025
@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

NolanHeffner commented Nov 9, 2025

All tests that I ran are contained on the Hardware Team OneNote under 2025-11-8. I agree that another round of testing is needed. I am mostly concerned about the potential for the circuit to use dirty ancillas, since not all operations reset their ancillas before/after use. Other than that, most changes were just a wrapper call to the reservoir and so the circuit structure is visually extremely similar.

@RasmitDevkota
Copy link
Copy Markdown
Member

I don't seem to see those results, could you list them out here anyways though since the OneNote is currently an internal log which isn't available to the public and it would be nice to have a one-stop reference for such a big change?

@RasmitDevkota
Copy link
Copy Markdown
Member

RasmitDevkota commented Nov 9, 2025

I agree on the topic of dirty ancillas, that's something we need to test (and fix, if applicable) before merging this change. For one, it may help to merge my recent LogicalGateBenchmarking demo notebook into this branch and check those plots against what we have currently.

@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

NolanHeffner commented Nov 9, 2025

I don't seem to see those results, could you list them out here anyways though since the OneNote is currently an internal log which isn't available to the public and it would be nice to have a one-stop reference for such a big change?

AncillaReservoir Test Results.pdf
Relevant test logs attached as pdf.

The LogicalGateBenchmarking demo notebook has already been pulled into this branch (I believe through commit 8c56eb8). I will run the notebook and update with results.

@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

NolanHeffner commented Nov 9, 2025

{'x': {'physical_data': array([0.99925, 0.99942, 0.99946, 0.99934, 0.99937]),
'logical_data': array([0.98339, 0.98571, 0.98535, 0.9821 , 0.9868 ])},
'y': {'physical_data': array([0.99939, 0.99936, 0.99937, 0.99922, 0.99953]),
'logical_data': array([0.98167, 0.98551, 0.98482, 0.98392, 0.98614])},
'z': {'physical_data': array([0.99849, 0.99844, 0.99854, 0.99863, 0.99864]),
'logical_data': array([0.98588, 0.98564, 0.98653, 0.98332, 0.98228])},
'h': {'physical_data': array([0.999991, 0.999998, 1. , 0.999995, 1. ]),
'logical_data': array([0.98009, 0.97925, 0.97426, 0.979 , 0.97874])},
's': {'physical_data': array([0.99856, 0.99849, 0.99853, 0.99865, 0.99864]),
'logical_data': array([0.97931, 0.98019, 0.98106, 0.98315, 0.9829 ])},
't': {'physical_data': array([0.99864, 0.99867, 0.99865, 0.99856, 0.99859]),
'logical_data': array([0.97677, 0.97442, 0.97594, 0.97522, 0.97317])}}

image

It seems the logical fidelities are slightly lower than the physical fidelities. How does this compare to the main branch results?

@RasmitDevkota
Copy link
Copy Markdown
Member

Looks like the fidelities went down, worried about that. Is that with any changes to the notebook, or the exact state it is in on the main branch?

@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

git pull indicates the branch is up to date with main, and no changes have been made to the notebook. Can you direct me to the main branch results?

@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

@RasmitDevkota I ran LogicalGateBenchmarking.ipynb on the main branch and achieved comparable results to the ancilla_reservoir branch. I am confused what conditions let to 99.0%+ F_L?

image

@NolanHeffner
Copy link
Copy Markdown
Collaborator Author

LCU_Corrected methods may not be handled correctly if their ancillas need to be preserved, but I'm down to fix that later / add warnings.

Here are benchmarking results with 1E5 physical shots and 1E4 logical shots on a slightly earlier version of this branch:
image

For comparison, here is 1E4 physical shots and 1E3 logical shots for benchmarking of code copied from the main branch. The copying was performed a couple of months ago, the benchmarking was conducted today.
image

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