PauliRegister Type
Represents a tensor product of single-qubit Pauli operators with a complex coefficient.
A PauliRegister of size n represents an operator on n qubits:
coefficient
where each Pᵢ ∈ {I, X, Y, Z} is a single-qubit Pauli operator.
Examples:
"XII" with coefficient 1.0 = X₀ ⊗ I₁ ⊗ I₂ "ZZ" with coefficient -0.5 = -0.5 · (Z₀ ⊗ Z₁)
Constructors
| Constructor |
Description
|
Full Usage:
PauliRegister(ops, coefficient)
Parameters:
Pauli seq
-
Sequence of Pauli operators.
coefficient : Complex
-
The complex coefficient for this term.
Returns: PauliRegister
|
Creates a PauliRegister from a sequence of Pauli operators.
|
Full Usage:
PauliRegister(ops, coefficient)
Parameters:
Pauli list
-
List of Pauli operators [P₀; P₁; ...; Pₙ₋₁].
coefficient : Complex
-
The complex coefficient for this term.
Returns: PauliRegister
|
Creates a PauliRegister from a list of Pauli operators.
|
Full Usage:
PauliRegister(ops, coefficient)
Parameters:
string
-
A string like "XYZII" where each character is I, X, Y, or Z.
coefficient : Complex
-
The complex coefficient for this term.
Returns: PauliRegister
|
Creates a PauliRegister from a string of Pauli characters.
Example
val reg: obj
|
Full Usage:
PauliRegister(n, ?coefficient)
Parameters:
uint32
-
The number of qubits (register size).
?coefficient : Complex
-
Optional complex coefficient (default: 1.0).
Returns: PauliRegister
|
Creates a new PauliRegister with all identity operators.
|
Instance members
| Instance member |
Description
|
|
Gets the complex coefficient of this Pauli term.
|
Gets the Pauli operator at the given qubit index.
|
|
Full Usage:
this.PhaseConjunction
Returns: string
|
Gets a formatted conjunction string for combining terms in a sum. Used when building sum expressions like "X + iY - Z".
|
Full Usage:
this.PhasePrefix
Returns: string
|
Gets a formatted string prefix representing the coefficient phase. Used for display purposes, e.g., "+", "-", "+i", "-i".
|
Full Usage:
this.ResetPhase
Parameters:
Complex
-
The new complex coefficient.
Returns: PauliRegister
A new PauliRegister with the same operators but different coefficient.
|
Creates a copy of this register with a new coefficient.
|
Full Usage:
this.Signature
Returns: string
A string like "XYZII" representing the tensor product structure.
|
Gets the signature string of this register (operators without coefficient). The signature uniquely identifies the Pauli structure and is used as a dictionary key when combining like terms in a PauliRegisterSequence.
|
Full Usage:
this.WithOperatorAt
Parameters:
int
-
The zero-based qubit index to modify.
op : Pauli
-
The new Pauli operator to place at index i.
Returns: PauliRegister
A new PauliRegister with the updated operator.
|
Returns a new PauliRegister with the operator at index i replaced. This operation is immutable - it returns a new register without modifying the original.
|
Static members
| Static member |
Description
|
Full Usage:
l * r
Parameters:
PauliRegister
-
The left PauliRegister.
r : PauliRegister
-
The right PauliRegister.
Returns: PauliRegister
A new PauliRegister representing the product, with coefficients and
phases properly combined.
|
Multiplies two PauliRegisters component-wise.
Multiplication is performed qubit-by-qubit in O(n) time:
where φ is the accumulated phase from all the individual Pauli multiplications. If registers have different sizes, missing qubits are treated as identity.
|