-
Notifications
You must be signed in to change notification settings - Fork 47
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
Apply a PauliMeasurement to a PauliFrame #411
Comments
Thank you for highlighting this issue. Based on the stack trace, the closest match is
|
Hi, @J-C-Q, Quinten. You are right, this is currently not supported for a few non-technical reasons. Below I describe our reasoning and the way we would currently perform such measurements in simulation. Please let me know if they address your needs -- we can also discus potential additions to the library that more closely match what you want to set up. Option 1: Alternative simulators (slower but providing additional functionality)As @Fe-r-oz mentioned, we have a Monte Carlo simulator that supports this feature (but it is naturally slower as it does not use Pauli frames) and an interesting "Symbolic Perturbative Expansion" simulator that can give you symbolic results instead of just numerical estimates (also much slower though). Option 2: Using an ancilla qubitThe Pauli frame simulator supports single qubit measurements with the julia> using QuantumClifford, QuantumClifford.ECC, Quantikz
julia> parity_checks = S"ZZ" # add more rows if you want more checks
+ ZZ
julia> circuit, nbanc, resultbits = naive_syndrome_circuit(parity_checks) # you can change the indices of the aux qubits and bit-storage locations
(QuantumClifford.AbstractOperation[sCNOT(1,3), sCNOT(2,3), sMRZ(3, 1)], 1, 1:1) julia> full_circuit = [sHadamard(1), sHadamard(2), circuit...] julia> traj_result = pftrajectories(full_circuit; trajectories=1000);
julia> pfmeasurements(traj_result) |> mean # from Statistics
0.535 Option 3: Implementing a Pauli frame runner for
|
Amazing! Option 2 is what I thought I could avoid, but is indeed what I want. Since I want mid-circuit measurements, option 4 sadly doesn't work for my use case. I would be thrilled to give option 3 a try. However, a low-level implementation seems a bit over my head right now. What do you think about a layer of abstraction to make it work, where we basically insert option 2 here under the hood? Similar to how |
I like your suggestion. It is indeed possible to do "option 2 under the hood", but the problem would be that ancillary qubits will need to be made available in the Pauli frame object. That is doable, but would be annoying to track. I would suggest the following:
|
Describe the bug 🐞
It is not possible to apply a PauliMeasurement to a PauliFrame.
Expected behavior
Using the
pftrajectories()
function, I thought I would be able to simulate a circuit that includes PauliMeasurements, likePauliMeasurement(P"ZZ", 1)
Minimal Reproducible Example 👇
Error & Stacktrace or other complete output produced by the MRE⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
I'm guessing there just isn't a function for this type yet? How difficult do you think it would be to implement this? Or am I not getting something here why this is not possible?
Thanks!
The text was updated successfully, but these errors were encountered: