mimiqcircuits.operations.operators.sigmas

Classes

SigmaMinus([a])

One-qubit operator corresponding to \(|0 \rangle\langle 1|\).

SigmaPlus([a])

One-qubit operator corresponding to \(|1 \rangle\langle 0|\).

class SigmaMinus(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to \(|0 \rangle\langle 1|\).

Matrix Representation

\[\begin{split}\begin{pmatrix} 0 & a\\ 0 & 0 \end{pmatrix}\end{split}\]

The factor a scales the operator, for example to add a phase. The operator is not unitary, so it cannot be applied to a circuit directly; use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor. Defaults to 1.

See also

SigmaPlus

Examples

>>> from mimiqcircuits import *
>>> SigmaMinus()
SigmaMinus(1)
>>> SigmaMinus(0.5)
SigmaMinus(0.5)
>>> # expectation value on qubit 1, stored in z-variable 1
>>> c = Circuit()
>>> c.push(ExpectationValue(SigmaMinus()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨SigmaMinus(1)⟩ @ q[1], z[1]
property parnames

Names of the operation’s parameters, as a tuple of strings.

Read-only: assigning to it raises ValueError.

property num_qubits

Number of qubits the operation acts on.

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O = |a|^2 |1\rangle\langle 1|\) as a Projector1.

class SigmaPlus(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to \(|1 \rangle\langle 0|\).

Matrix Representation

\[\begin{split}\begin{pmatrix} 0 & 0\\ a & 0 \end{pmatrix}\end{split}\]

The factor a scales the operator, for example to add a phase. The operator is not unitary, so it cannot be applied to a circuit directly; use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor. Defaults to 1.

See also

SigmaMinus

Examples

>>> from mimiqcircuits import *
>>> SigmaPlus()
SigmaPlus(1)
>>> SigmaPlus(0.5)
SigmaPlus(0.5)
>>> # expectation value on qubit 1, stored in z-variable 1
>>> c = Circuit()
>>> c.push(ExpectationValue(SigmaPlus()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨SigmaPlus(1)⟩ @ q[1], z[1]
property parnames

Names of the operation’s parameters, as a tuple of strings.

Read-only: assigning to it raises ValueError.

property num_qubits

Number of qubits the operation acts on.

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O = |a|^2 |0\rangle\langle 0|\) as a Projector0.