-
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
Clifford representation incorporating global phase #1667
base: main
Are you sure you want to change the base?
Conversation
I may have been a little stupid in creating this. I only just realised that there is actually no need to keep it in a unique normal form, and relaxing the constraints on the form massively reduces the number of cases we need to consider (especially once I have also extended it to work with mixed states). I'm currently updating the document with the maths, and then will update the code to this simpler and more flexible version |
Description
This PR adds a new C++ class for the efficient simulation of Clifford states, including global phase. This is based on the "reduced affine with phases form" (reduced AP-form) described in [Chapter 5, “Picturing Quantum Software”, Kissinger & van de Wetering], tracking a normal form for the state which has a well-defined reference phase, from which we can track global phase as the relative difference.
This class comes with direct simulation in the basis {CZ, S, V} where these were found to give some of the simplest proofs of correctness, though this still involves many cases and the derivations are non-trivial. Proofs which track the global phase are available internally within Quantinuum, and can be provided to external colleagues on request. Other gate types are handled by reducing into this gate set, but I can add additional methods for them directly if that is preferred (e.g. Pauli gates are much simpler to perform directly than via S and V).
Due to the constraints of maintaining the normal form, this is noticeably more expensive than tableau simulation, since each gate takes O(n^2) time to apply (where n is the number of qubits in the circuit), as opposed to the O(n) time for tableau updates. Because of the increased cost, I am yet to incorporate this into any live optimisation pass. I'd appreciate some suggestions on where we think it is worth it to add cost for global phase tracking or if there is a nice way to make that optional depending on the user's requirements. Similarly, the complexity of this makes me not want to expose it to Python users yet unless others can think of a good use case where people want direct access to it.
Converters are included to go between
APState
andCircuit
orSymplecticTableau
(from which one can wrap it in aChoiMixTableau
, constrained to pure states).I'd like to be able to use this in the new
PauliGraph
class, butChoiMixTableau
still provides more utility, from supporting mixed processes and the rows having semantic meaning to the rest of the class. The only way I can think of incorporating global phases would be to duplicate tracking of the Clifford regions via both aChoiMixTableau
(for the semantic value of the rows and simplifying rewrite strategies on the graph) and anAPState
to track global phase changes (in this case, where it is enough to just track the phase without trying to maintain the entire semantics, it is sufficient to simulate the result of applying the linear map to the |0> state, rather than simulating the entire isometry as an open process, which does reduce the cost). I'm keen to hear any other suggestions for how to handle this, and if there is a way to do it without duplication.Related issues
Closes #1659
Checklist