Header menu logo Encodings

C<'unit> Type

A coefficient-operator pair: a complex coefficient times a single operator unit.

C represents the simplest term in the operator algebra: a scalar coefficient multiplied by a single operator. Mathematically: c × Ô where c ∈ ℂ and Ô is an operator.

Examples:

  • 1.0 × a†₂ — creation operator on mode 2
  • 0.5 × X₀ — half times Pauli-X on qubit 0
  • i × Z₁ — imaginary unit times Pauli-Z on qubit 1

The (*) operator performs tensor product, yielding a P. The (+) operator combines like terms or creates a product.

Record fields

Record Field Description

Coeff

Full Usage: Coeff

Field type: Complex

The complex coefficient multiplying the operator.

Field type: Complex

Item

Full Usage: Item

Field type: 'unit

The operator unit (e.g., a single ladder operator or Pauli).

Field type: 'unit

Instance members

Instance member Description

this.IsZero

Full Usage: this.IsZero

Returns: bool

Indicates whether the coefficient is zero (making the entire term zero).

Returns: bool

this.Reduce

Full Usage: this.Reduce

Returns: C<'unit>

Returns a reduced form with the coefficient sanitized (non-finite values become zero).

Returns: C<'unit>

Static members

Static member Description

l * r

Full Usage: l * r

Parameters:
    l : C<'unit> - The left operand.
    r : C<'unit> - The right operand.

Returns: P<'unit> A P containing both operators in sequence, with combined coefficient. Returns zero product if coefficient is zero.

Tensor product operator: multiplies two coefficient-operator pairs.

Computes (c₁ × Ô₁) ⊗ (c₂ × Ô₂) = (c₁c₂) × (Ô₁ Ô₂).

l : C<'unit>

The left operand.

r : C<'unit>

The right operand.

Returns: P<'unit>

A P containing both operators in sequence, with combined coefficient. Returns zero product if coefficient is zero.

l + r

Full Usage: l + r

Parameters:
    l : C<'unit> - The left operand.
    r : C<'unit> - The right operand.

Returns: P<'unit> If both operands have the same unit, returns a single P with combined coefficient. Otherwise, returns a product containing both terms.

Sum operator: adds two coefficient-operator pairs.

For like terms: (c₁ × Ô) + (c₂ × Ô) = (c₁ + c₂) × Ô. For unlike terms: creates a product term [c₁Ô₁ | c₂Ô₂].

l : C<'unit>

The left operand.

r : C<'unit>

The right operand.

Returns: P<'unit>

If both operands have the same unit, returns a single P with combined coefficient. Otherwise, returns a product containing both terms.

C.Apply(coeff, unit)

Full Usage: C.Apply(coeff, unit)

Parameters:
    coeff : Complex - The complex coefficient (will be reduced if non-finite).
    unit : 'unit - The operator unit.

Returns: C<'unit> A C with the given coefficient and unit.

Creates a coefficient-operator pair with the specified coefficient.

coeff : Complex

The complex coefficient (will be reduced if non-finite).

unit : 'unit

The operator unit.

Returns: C<'unit>

A C with the given coefficient and unit.

C.Apply(unit)

Full Usage: C.Apply(unit)

Parameters:
    unit : 'unit - The operator unit.

Returns: C<'unit> A C with Coeff = 1 and the given unit.

Creates a coefficient-operator pair with coefficient 1.

unit : 'unit

The operator unit.

Returns: C<'unit>

A C with Coeff = 1 and the given unit.

Type something to start searching.