IxOp<'idx, 'op> Type
An indexed operator that pairs a site/qubit index with an operator.
IxOp is the fundamental building block for multi-site quantum operators. For example, the Pauli string X₀Z₂Y₃ is represented as a sequence of IxOp values: [(X, 0), (Z, 2), (Y, 3)].
The index typically represents a qubit number (for Pauli operators) or a fermionic mode number (for ladder operators).
Example
let xOnQubit0 = IxOp.Apply(0, Pauli.X)
let zOnQubit2 = IxOp.Apply(2, Pauli.Z)
Record fields
| Record Field |
Description
|
Full Usage:
Index
Field type: 'idx
|
The site or qubit index where this operator acts.
|
Full Usage:
Op
Field type: 'op
|
The operator acting at this index.
|
Static members
| Static member |
Description
|
Full Usage:
IxOp.Apply(index, op)
Parameters:
'a
-
The site/qubit index.
op : 'op
-
The operator to apply at that index.
Returns: IxOp<'a, 'op>
A new IxOp pairing the index with the operator.
|
Creates an IxOp from an index and operator.
|
Full Usage:
IxOp.IndicesInOrder(indexOrder) (ops)
Parameters:
IndexOrder
-
The expected ordering direction.
ops : IxOp<'idx, 'op> seq
-
The sequence of indexed operators to check.
Returns: bool
True if all indices satisfy the ordering constraint.
|
Checks whether a sequence of IxOp values has indices in the specified order.
|
Full Usage:
IxOp.TryCreateFromStringWith(indexParser) (unitFactory) (s)
Parameters:
string -> 'idx option
-
A function that parses the index from a string.
unitFactory : string -> 'op option
-
A function that parses the operator from a string.
s : String
-
The string to parse, expected in format "(op, index)".
Returns: IxOp<'idx, 'op> option
Some IxOp if parsing succeeds; None otherwise.
|
Attempts to parse an IxOp from a string representation.
Example
|