-
Notifications
You must be signed in to change notification settings - Fork 4
Description
In guppyalgos, we have found it very convenient to have methods that return new SeleneQuestStates but acting on a smaller number of qubits, either through projection, or simply discarding qubits that are not entangled. This is because it makes it much easier to analyse and compare smaller statevectors, and often a lot of the total statevector is irrelevant anyway (ancilla that are returned to 0 etc).
The current way that projection works is that you supply some bitstring that is the desired state of the specified_qubits, and then the relevant projected state on the unspecified qubits is returned.
The problem with this is if you want to do a series of these operations, then your simulation level specified_qubits may have indices that are larger than the total number of qubits in this subsystem state. You have to then keep track of which qubit indices are no longer present and recalculate indices to the 'local' subsystem state.
Some vague ideas for solutions I have thrown together examples of are:
- a wrapper for
SeleneQuestStatethat silently (probably not desirable) does this reindexing - a
ProjectedStatethat is essentially aTracedStatebut also has aset_specified_qubits()method to handle this logic
(happy to contribute this if it would be helpful, I would need access as I currently cannot add a branch to remote)