Header menu logo Encodings

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)
val xOnQubit0: obj
val zOnQubit2: obj

Record fields

Record Field Description

Index

Full Usage: Index

Field type: 'idx

The site or qubit index where this operator acts.

Field type: 'idx

Op

Full Usage: Op

Field type: 'op

The operator acting at this index.

Field type: 'op

Static members

Static member Description

l .<=. r

Full Usage: l .<=. r

Parameters:
    l : IxOp<'idx, 'op>
    r : IxOp<'idx, 'op>

Returns: bool

Less-than-or-equal comparison by index.

l : IxOp<'idx, 'op>
r : IxOp<'idx, 'op>
Returns: bool

l .>=. r

Full Usage: l .>=. r

Parameters:
    l : IxOp<'idx, 'op>
    r : IxOp<'idx, 'op>

Returns: bool

Greater-than-or-equal comparison by index.

l : IxOp<'idx, 'op>
r : IxOp<'idx, 'op>
Returns: bool

IxOp.Apply(index, op)

Full Usage: IxOp.Apply(index, op)

Parameters:
    index : '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.

index : '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.

IxOp.IndicesInOrder(indexOrder) (ops)

Full Usage: IxOp.IndicesInOrder(indexOrder) (ops)

Parameters:
    indexOrder : 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.

indexOrder : 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.

IxOp.TryCreateFromStringWith(indexParser) (unitFactory) (s)

Full Usage: IxOp.TryCreateFromStringWith(indexParser) (unitFactory) (s)

Parameters:
    indexParser : 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.

indexParser : 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.

Example

 // Parse "(X, 0)" with uint32 index and Pauli operator
 IxOp.TryCreateFromStringWith parseUint32 Pauli.TryParse "(X, 0)"

Type something to start searching.