mindquantum.core.operators.Projector

View Source On Gitee
class mindquantum.core.operators.Projector(proj)[source]

Projector operator.

For a projector shown as below:

\[\left|01\right>\left<01\right|\otimes I^2\]

The string format would be '01II'.

Note

The lower index qubit is at the right end of string format of bra and ket.

Parameters

proj (str) – The string format of the projector.

Examples

>>> from mindquantum.core.operators import Projector
>>> p = Projector('II010')
>>> p
I2 ⊗ ¦010⟩⟨010¦