BasicRotationGate
Extends:
Defines a base class of a rotation gate.
A rotation gate has a continuous parameter (the angle), labeled 'angle' / this.angle. Its inverse is the same gate with the negated argument. Rotation gates of the same class can be merged by adding the angles. The continuous parameter is modulo 4 pi, this.angle is in the interval [0, 4 pi).
Constructor Summary
| Public Constructor | ||
| public |
constructor(angle: *) |
|
Member Summary
| Public Members | ||
| public |
angle: * |
|
Method Summary
| Public Methods | ||
| public |
|
|
| public |
|
|
| public |
getMerged(other: BasicRotationGate | Object): BasicRotationGate Return self merged with another gate. |
|
| public |
Return the Latex string representation of a BasicRotationGate. |
|
| 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(angle: *) source
Override:
BasicGate#constructorParams:
| Name | Type | Attribute | Description |
| angle | * | {number} Angle of rotation (saved modulo 4 * pi) |
Public Members
public angle: * source
Public Methods
public equal(other: *): boolean source
Override:
BasicGate#equalParams:
| Name | Type | Attribute | Description |
| other | * |
public getInverse(): BasicRotationGate source
Override:
BasicGate#getInverseReturn:
| BasicRotationGate | Return the inverse of this rotation gate (negate the angle, return new object). |
public getMerged(other: BasicRotationGate | Object): BasicRotationGate source
Return self merged with another gate.
Default implementation handles rotation gate of the same type, where angles are simply added.
Override:
BasicGate#getMergedParams:
| Name | Type | Attribute | Description |
| other | BasicRotationGate | Object |
Throw:
For non-rotation gates or rotation gates of different type. |