mimiqcircuits.operations.operators.projectors

Functions

to_subscript(number)

Classes

Projector0([a])

One-qubit operator corresponding to a projection onto \(|0\rangle\).

Projector00([a])

Two-qubit operator corresponding to a projection onto \(|00\rangle\).

Projector01([a])

Two-qubit operator corresponding to a projection onto \(|01\rangle\).

Projector1([a])

One-qubit operator corresponding to a projection onto \(|1\rangle\).

Projector10([a])

Two-qubit operator corresponding to a projection onto \(|10\rangle\).

Projector11([a])

Two-qubit operator corresponding to a projection onto \(|11\rangle\).

ProjectorX0([a])

One-qubit operator corresponding to a projection onto \(|+\rangle\).

ProjectorX1([a])

One-qubit operator corresponding to a projection onto \(|-\rangle\).

ProjectorY0([a])

One-qubit operator corresponding to a projection onto \(|{+i}\rangle\).

ProjectorY1([a])

One-qubit operator corresponding to a projection onto \(|{-i}\rangle\).

ProjectorZ0()

Alias of Projector0.

ProjectorZ1()

Alias of Projector1.

class Projector0(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|0\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator. Equivalent to DiagonalOp(a, 0).

See also

Projector1, DiagonalOp

Parameters:

a (complex) – The top-left entry of the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector0()
P₀(1)
>>> Projector0(0.5)
P₀(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector0()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₀(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class Projector00(a=1)[source]

Bases: AbstractOperator

Two-qubit operator corresponding to a projection onto \(|00\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector00()
P₀₀(1)
>>> Projector00(0.5)
P₀₀(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector00()), 1, 2, 1)
3-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₀₀(1)⟩ @ q[1:2], z[1]
property parnames

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

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class Projector01(a=1)[source]

Bases: AbstractOperator

Two-qubit operator corresponding to a projection onto \(|01\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector01()
P₀₁(1)
>>> Projector01(0.5)
P₀₁(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector01()), 1, 2, 1)
3-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₀₁(1)⟩ @ q[1:2], z[1]
property parnames

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

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class Projector1(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|1\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator. Equivalent to DiagonalOp(0, a).

See also

Projector0, DiagonalOp

Parameters:

a (complex) – The bottom-right entry of the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector1()
P₁(1)
>>> Projector1(0.5)
P₁(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector1()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₁(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class Projector10(a=1)[source]

Bases: AbstractOperator

Two-qubit operator corresponding to a projection onto \(|10\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector10()
P₁₀(1)
>>> Projector10(0.5)
P₁₀(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector10()), 1, 2, 1)
3-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₁₀(1)⟩ @ q[1:2], z[1]
property parnames

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

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class Projector11(a=1)[source]

Bases: AbstractOperator

Two-qubit operator corresponding to a projection onto \(|11\rangle\).

Matrix Representation

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

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> Projector11()
P₁₁(1)
>>> Projector11(0.5)
P₁₁(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(Projector11()), 1, 2, 1)
3-qubit, 2-zvar circuit with 1 instruction:
└── ⟨P₁₁(1)⟩ @ q[1:2], z[1]
property parnames

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

Read-only: assigning to it raises ValueError.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class ProjectorY1(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|{-i}\rangle\).

Matrix Representation

\[\begin{split}\frac{a}{2} \begin{pmatrix} 1 & i \\ -i & 1 \end{pmatrix}\end{split}\]

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

See also

ProjectorY0

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> ProjectorY1()
PY₁(1)
>>> ProjectorY1(0.5)
PY₁(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(ProjectorY1()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨PY₁(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class ProjectorY0(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|{+i}\rangle\).

Matrix Representation

\[\begin{split}\frac{a}{2} \begin{pmatrix} 1 & -i \\ i & 1 \end{pmatrix}\end{split}\]

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

See also

ProjectorY1

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> ProjectorY0()
PY₀(1)
>>> ProjectorY0(0.5)
PY₀(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(ProjectorY0()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨PY₀(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class ProjectorX1(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|-\rangle\).

Matrix Representation

\[\begin{split}\frac{a}{2} \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}\end{split}\]

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

See also

ProjectorX0

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> ProjectorX1()
PX₁(1)
>>> ProjectorX1(0.5)
PX₁(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(ProjectorX1()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨PX₁(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class ProjectorX0(a=1)[source]

Bases: AbstractOperator

One-qubit operator corresponding to a projection onto \(|+\rangle\).

Matrix Representation

\[\begin{split}\frac{a}{2} \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}\end{split}\]

The factor a scales the projector, for example to add a phase. The operator is not unitary: use it in an ExpectationValue or as a Kraus operator.

See also

ProjectorX1

Parameters:

a (complex) – Scaling factor for the matrix. Defaults to 1.

Examples

>>> from mimiqcircuits import *
>>> ProjectorX0()
PX₀(1)
>>> ProjectorX0(0.5)
PX₀(0.5)
>>> c = Circuit()
>>> c.push(ExpectationValue(ProjectorX0()), 1, 1)
2-qubit, 2-zvar circuit with 1 instruction:
└── ⟨PX₀(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.

opsquared()[source]

Return \(O^\dagger O\), the same projector scaled by \(|a|^2\).

class ProjectorZ1[source]

Bases: AbstractOperator

Alias of Projector1.

ProjectorZ1() takes no arguments and returns Projector1().

Examples

>>> from mimiqcircuits import *
>>> ProjectorZ1()
P₁(1)
class ProjectorZ0[source]

Bases: AbstractOperator

Alias of Projector0.

ProjectorZ0() takes no arguments and returns Projector0().

Examples

>>> from mimiqcircuits import *
>>> ProjectorZ0()
P₀(1)