cirq.google.XmonStepResult.state¶
-
XmonStepResult.state() → numpy.ndarray[source]¶ Return the state (wave function) at this point in the computation.
The state is returned in the computational basis with these basisstates defined by the qubit_map. In particular the value in thequbit_map is the index of the qubit, and these are translated intobinary vectors where the last qubit is the 1s bit of the index, thesecond-to-last is the 2s bit of the index, and so forth (i.e. bigendian ordering).Example
qubit_map: {QubitA: 0, QubitB: 1, QubitC: 2}Then the returned vector will have indices mapped to qubit basisstates like the following table| | QubitA | QubitB | QubitC |+—+——–+——–+——–+| 0 | 0 | 0 | 0 || 1 | 0 | 0 | 1 || 2 | 0 | 1 | 0 || 3 | 0 | 1 | 1 || 4 | 1 | 0 | 0 || 5 | 1 | 0 | 1 || 6 | 1 | 1 | 0 || 7 | 1 | 1 | 1 |+—+——–+——–+——–+