Header menu logo Encodings

IndexedTerms Module

Indexed operator types for tracking qubit/mode assignments.

Each IxOp wraps an operator unit with an integer index identifying which qubit (or fermionic mode) it acts on. This is essential for multi-qubit Pauli strings where the position of each Pauli matters: X₀ Z₁ I₂ Y₃ = XZIY.

Types

Type Description

IndexOrder

Specifies the ordering direction for indexed operators.

IxOp<'idx, 'op>

An indexed operator that pairs a site/qubit index with an operator.

PIxOp<'idx, 'op>

A product of indexed operators, representing a tensor product of operators at specific sites.

SIxOp<'idx, 'op>

A sum of products of indexed operators, representing a linear combination.

Functions and values

Function or value Description

isOrdered comparer xs

Full Usage: isOrdered comparer xs

Parameters:
    comparer : 'a -> 'a -> bool - A function that returns true if the first argument should come before or equal to the second.
    xs : 'a seq - The sequence to check for ordering.

Returns: bool True if all adjacent pairs satisfy the comparator; false otherwise.

Checks whether a sequence is ordered according to a given comparator.

comparer : 'a -> 'a -> bool

A function that returns true if the first argument should come before or equal to the second.

xs : 'a seq

The sequence to check for ordering.

Returns: bool

True if all adjacent pairs satisfy the comparator; false otherwise.

tryParseIxOpUint32 unitFactory

Full Usage: tryParseIxOpUint32 unitFactory

Parameters:
    unitFactory : string -> 'op option - A function that parses the operator from a string.

Returns: string -> IxOp<uint32, 'op> option A parser function that returns Some IxOp on success, None on failure.

Parses an IxOp with a uint32 index from a string like "(op, 123)".

This is a convenience function for the common case where indices are unsigned 32-bit integers (qubit numbers).

unitFactory : string -> 'op option

A function that parses the operator from a string.

Returns: string -> IxOp<uint32, 'op> option

A parser function that returns Some IxOp on success, None on failure.

Type something to start searching.