DaggeredGate
Extends:
Wrapper class allowing to execute the inverse of a gate, even when it does not define one.
If there is a replacement available, then there is also one for the inverse, namely the replacement function run in reverse, while inverting all gates. This class enables using this emulation automatically.
A DaggeredGate is returned automatically when employing the getInverse- function on a gate which does not provide a getInverse() member function.
Example:
with Dagger(eng)
MySpecialGate | qubits
will create a DaggeredGate if MySpecialGate does not implement
getInverse. If there is a decomposition function available, an auto-
replacer engine can automatically replace the inverted gate by a call to
the decomposition function inside a "with Dagger"-statement.
Constructor Summary
| Public Constructor | ||
| public |
constructor(gate: BasicGate) |
|
Member Summary
| Public Members | ||
| public |
gate: * |
|
| public get |
matrix: * |
|
| Private Members | ||
| private |
_matrix: * |
|
Method Summary
| Public Methods | ||
| public |
equal(other: *): * Return true if self is equal to other, i.e., same type and representing the inverse of the same gate. |
|
| public |
getInverse(): * |
|
| public |
|
|
| public |
|
|
Inherited Summary
| From class BasicGate | ||
| public static |
Convert quantum input of "gate | quantum input" to internal formatting. |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
generateCommand(qubits: *): Command Helper function to generate a command consisting of the gate and the qubits being acted upon. |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
or(qubits: *) Operator| overload which enables the syntax Gate | qubits. |
|
| public |
toString() |
|
Public Constructors
public constructor(gate: BasicGate) source
Override:
BasicGate#constructorParams:
| Name | Type | Attribute | Description |
| gate | BasicGate | Any gate object of which to represent the inverse. |
Public Members
public gate: * source
public get matrix: * source
Private Members
private _matrix: * source
Public Methods
public equal(other: *): * source
Return true if self is equal to other, i.e., same type and representing the inverse of the same gate.
Override:
BasicGate#equalParams:
| Name | Type | Attribute | Description |
| other | * |
Return:
| * |