We're celebrating World Quantum Day 2022! Join us

cirq.qis.QuantumStateRepresentation

can_represent_mixed_states Subclasses that can represent mixed states should override this.
supports_factor Subclasses that allow factorization should override this.

Methods

copy

View source

Creates a copy of the object.

Args
deep_copy_buffers If True, buffers will also be deep-copied. Otherwise the copy will share a reference to the original object's buffers.

Returns
A copied instance.

factor

View source

Splits two state spaces after a measurement or reset.

kron

View source

Joins two state spaces together.

measure

View source

Measures the state.

Args
axes The axes to measure.
seed The random number seed to use.

Returns
The measurements in order.

reindex

View source

Physically reindexes the state by the new basis.

Args
axes The desired axis order.

Returns
The state with qubit order transposed and underlying representation updated.

sample

View source

Samples the state. Subclasses can override with more performant method.

Args
axes The axes to sample.
repetitions The number of samples to make.
seed The random number seed to use.

Returns
The samples in order.