mimiqcircuits.operations.operators.projectors¶
Functions
|
Classes
|
One-qubit operator corresponding to a projection onto \(|0\rangle\). |
|
Two-qubit operator corresponding to a projection onto \(|00\rangle\). |
|
Two-qubit operator corresponding to a projection onto \(|01\rangle\). |
|
One-qubit operator corresponding to a projection onto \(|1\rangle\). |
|
Two-qubit operator corresponding to a projection onto \(|10\rangle\). |
|
Two-qubit operator corresponding to a projection onto \(|11\rangle\). |
|
One-qubit operator corresponding to a projection onto \(|+\rangle\). |
|
One-qubit operator corresponding to a projection onto \(|-\rangle\). |
|
One-qubit operator corresponding to a projection onto \(|{+i}\rangle\). |
|
One-qubit operator corresponding to a projection onto \(|{-i}\rangle\). |
Alias of |
|
Alias of |
- class Projector0(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator. Equivalent toDiagonalOp(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.
- class Projector00(a=1)[source]¶
Bases:
AbstractOperatorTwo-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class Projector01(a=1)[source]¶
Bases:
AbstractOperatorTwo-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class Projector1(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator. Equivalent toDiagonalOp(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.
- class Projector10(a=1)[source]¶
Bases:
AbstractOperatorTwo-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class Projector11(a=1)[source]¶
Bases:
AbstractOperatorTwo-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class ProjectorY1(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class ProjectorY0(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class ProjectorX1(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class ProjectorX0(a=1)[source]¶
Bases:
AbstractOperatorOne-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
ascales the projector, for example to add a phase. The operator is not unitary: use it in anExpectationValueor as a Kraus operator.See also
- 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.
- class ProjectorZ1[source]¶
Bases:
AbstractOperatorAlias of
Projector1.ProjectorZ1()takes no arguments and returnsProjector1().Examples
>>> from mimiqcircuits import * >>> ProjectorZ1() P₁(1)
- class ProjectorZ0[source]¶
Bases:
AbstractOperatorAlias of
Projector0.ProjectorZ0()takes no arguments and returnsProjector0().Examples
>>> from mimiqcircuits import * >>> ProjectorZ0() P₀(1)