symop.core.monomial

Monomials of ladder operators.

This module defines the Monomial data structure, representing ordered products of creation and annihilation operators together with structural queries and signatures used for hashing and merging.

Classes

Monomial(creators, ...] =, annihilators, ...] =)

A normally ordered product of ladder operators.

class Monomial(creators: tuple[~symop.core.protocols.ops.operators.LadderOp, ...]=<factory>, annihilators: tuple[~symop.core.protocols.ops.operators.LadderOp, ...]=<factory>) None

Bases: object

A normally ordered product of ladder operators.

A Monomial represents a single term in the operator algebra, consisting of an ordered tuple of creation and annihilation operators. The default empty monomial (without operators) corresponds to the identity operator.

Parameters:
  • creators (tuple[LadderOp, ...])

  • annihilators (tuple[LadderOp, ...])

creators

Tuple of creation operators applied in order from left to right.

annihilators

Tuple of annihilation operators applied in order from left to right.

Properties:
mode_ops: Unique ordered tuple of all mode operators appearing

in the monomial.

signature: Exact tuple identifier of the monomial, used for sorting

and comparing.

approx_signature: Approximate identifier for nearly equivalent

monomials, used in numerical merging.

is_creator_only: Returns True if the monomial contains only

creation operators.

adjoint()

Returns the Hermitian adjoint of the monomial by swapping creators and annihilators and taking their individual adjoints.

Return type:

Monomial

Notes

  • The monomial is assumed to be in normal order, meaning all creation operators precede the annihilation operators.

  • An empty monomial (creators=(), annihilators=()) represents the identity operator \(\\mathbb{I}\).

This class implements Monomial protocol.

adjoint() Monomial

Return an adjoint of this Monomial.

Return type:

Monomial

annihilators: tuple[LadderOp, ...]
approx_signature(*, decimals: int = 12, ignore_global_phase: bool = False) tuple[object, ...]

Return an approximate signature.

Parameters:
  • decimals (int)

  • ignore_global_phase (bool)

Return type:

tuple[object, …]

creators: tuple[LadderOp, ...]
property has_annihilators: bool

Return True if this ``Monomial has any annihilators.

property has_creators: bool

Return True if this Monomial has any creators.

static identity() Monomial

Return an identity Monomial.

Return type:

Monomial

property is_annihilator_only: bool

Return True if this Monomial consists of annihilators only.

property is_creator_only: bool

Returns True if this Monomial consists of creators only.

property is_identity: bool

Return True if this Monomial represents an identity.

property mode_ops: tuple[ModeOp, ...]

Return all unique ModeOps from creators and annihilators.

property signature: tuple[object, ...]

Return a signature.