Header menu logo Encodings

PauliRegisterSequence Type

Represents a sum of PauliRegisters with complex coefficients.

A PauliRegisterSequence represents a linear combination of Pauli strings, which is the standard form for qubit Hamiltonians:

   H = Σₐ cₐ σₐ = c

Terms with identical Pauli signatures are automatically combined by summing their coefficients. Terms that cancel (coefficient becomes zero) are removed.

Example: A 2-qubit Heisenberg coupling might be represented as:

   H = J

Constructors

Constructor Description

PauliRegisterSequence(registerSets)

Full Usage: PauliRegisterSequence(registerSets)

Parameters:
Returns: PauliRegisterSequence

Creates a PauliRegisterSequence by combining multiple sequences.

All terms from all input sequences are combined, with like terms summed. Each input sequence's coefficient is distributed to its terms before merging.

registerSets : PauliRegisterSequence[]

Array of PauliRegisterSequences to merge.

Returns: PauliRegisterSequence

PauliRegisterSequence(registers)

Full Usage: PauliRegisterSequence(registers)

Parameters:
Returns: PauliRegisterSequence

Creates a PauliRegisterSequence from an array of PauliRegisters.

Terms with identical signatures are automatically combined.

registers : PauliRegister[]

Array of Pauli terms to sum.

Returns: PauliRegisterSequence

PauliRegisterSequence()

Full Usage: PauliRegisterSequence()

Returns: PauliRegisterSequence

Creates an empty PauliRegisterSequence with unit coefficient.

Returns: PauliRegisterSequence

Instance members

Instance member Description

this.AsString

Full Usage: this.AsString

Returns: Lazy<string>

Lazily computed string representation of the sum.

Returns: Lazy<string>

this.Coefficient

Full Usage: this.Coefficient

Returns: Complex

Gets the global coefficient of this sequence.

Returns: Complex

this.DistributeCoefficient

Full Usage: this.DistributeCoefficient

Returns: PauliRegisterSequence A PauliRegisterSequence where each term's coefficient is multiplied by the sequence's global coefficient, and the global coefficient is reset to 1.

Returns a new sequence with the global coefficient distributed to all terms.

Transforms: c · (c₁σ₁ + c₂σ₂) → (c·c₁)σ₁ + (c·c₂)σ₂

Returns: PauliRegisterSequence

A PauliRegisterSequence where each term's coefficient is multiplied by the sequence's global coefficient, and the global coefficient is reset to 1.

this[key]

Full Usage: this[key]

Parameters:
    key : string - The signature string (e.g., "XYZ").

Returns: bool * PauliRegister A tuple (found, register) where found indicates if the key exists.

Looks up a term by its Pauli signature.

key : string

The signature string (e.g., "XYZ").

Returns: bool * PauliRegister

A tuple (found, register) where found indicates if the key exists.

this.SummandTerms

Full Usage: this.SummandTerms

Returns: PauliRegister array An array of PauliRegisters representing each term in the sum.

Gets all the individual Pauli terms in this sequence.

Returns: PauliRegister array

An array of PauliRegisters representing each term in the sum.

Static members

Static member Description

l * r

Full Usage: l * r

Parameters:
Returns: PauliRegisterSequence A new PauliRegisterSequence containing all pairwise products of terms.

Multiplies two PauliRegisterSequences, distributing over all terms.

Computes the full product by distributing multiplication:

   (Σᵢ cᵢσᵢ) * (Σⱼ dⱼτⱼ) = Σᵢⱼ (cᵢdⱼ)(σᵢτⱼ)

If both sequences have m and n terms respectively, the result may have up to m×n terms (fewer if some products combine or cancel).

l : PauliRegisterSequence

The left sequence.

r : PauliRegisterSequence

The right sequence.

Returns: PauliRegisterSequence

A new PauliRegisterSequence containing all pairwise products of terms.

Type something to start searching.