Clifford representation incorporating global phase #1667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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