OperatorNamed
Represents a named spin-1/2 operator acting on specified sites. Create instances using factory functions like X(), Y(), Z(), CNOT(), SWAP(), etc.
Factories
CNOT(const List<integer> sites) -> OperatorNamed
Returns a spin-1/2 OperatorNamed for the CNOT (controlled-NOT) gate, taking a vector of site indices.
Parameters
- sites: Vector of two site indices: [control, target].
Example
var cnot2 = CNOT([1, 2])
CNOT(integer site0, integer site1) -> OperatorNamed
Returns a spin-1/2 OperatorNamed for the CNOT (controlled-NOT) gate, taking two individual site indices.
Parameters
- site0: The control qubit site index.
- site1: The target qubit site index.
Example
var cnot1 = CNOT(0, 1)
Hgate(integer site) -> OperatorNamed
Returns a spin-1/2 OperatorNamed for the Hadamard gate.
Parameters
- site: The site index where the operator acts (exactly 1 site required).
Example
var h0 = Hgate(0)
Proj0(integer site) -> OperatorNamed
Returns a spin-1/2 OperatorNamed for the projector .
Parameters
- site: The site index where the operator acts (exactly 1 site required).
Example
var p0_op = Proj0(0)
Proj1(integer site) -> OperatorNamed
Returns a spin-1/2 OperatorNamed for the projector .
Parameters
- site: The site index where the operator acts (exactly 1 site required).
Example
var p1_op = Proj1(1)