Closed Randl closed 10 months ago
This seems like generally useful functionality, thanks for the suggestion. Is this something you'd be interested in contributing?
I have a basic implementation of a function that accepts a list of stabilizers and returns a circuit that outputs the state stabilized by this list. What should be the interface? Should it be a separate function or class method?
Thanks @Randl! I have discussed this with @ShellyGarion, and we believe that you really mean the StabilizerState
class and not the Clifford
class. To fully specify a Clifford
, we do need both the stabilizers and destabilizers (i.e. the full symplectic matrix), but to specify a StabilizerState
in theory we only stabilizers. Do you agree with this or are we missing something?
Internally the StabilizerState
stores a Clifford
, and this is where the suggested method of calculating the destabilizers from stabilizers (i.e. extending to a symplectic matrix) would be very useful. And indeed we currently do not have this in Qiskit. Note however that such an extension would not be unique.
In terms of the interface, we believe that this should be implemented as a class method in StabilizerState
, i.e. one should be able to use it somewhat like stab_state = StabilizerState.from_list( ['+XXX', '+IZZ', '+ZZI'])
. If you can think of a better name than from_list
, that would be great.
Can I assign you to this issue? Thank you very much!
One more comment is that we already methods to create a StabilizerState
from a Clifford
, and a Clifford
from a quantum circuit with clifford gates.
@alexanderivrii Yes, you can assign me.
I think interface-wise it makes sense to have a function that given a set of stabilizers returns a (Clifford) circuit whose output (on zero input) is stabilized by this set. Note that this is more general than just stabilizer state since it, for example, allows to use underconstrained sets of stabilizers, which can be useful.
From this function we can get the StabilizerState
or Clifford
by existing constructors, thus it is the only new function needed.
I'll clean up my code and open a PR so we can have more constructive discussion.
What should we add?
As for now, the
Clifford
object can be created from a list of destabilizers and stabilizers. However, this is over-complete information for knowing whatClifford
is. Destabilizers can be calculated from stabilizers. When dealing with stabilizer states, destabilizers are not necessarily known, so it can come handy.