qdk_chemistry.data.symmetry module

Single-particle symmetry types and symmetry-blocked storage primitives.

This module exposes the single-particle symmetry types used to block quantum-chemistry tensors (orbital coefficients, energies, integrals, reduced density matrices) by conserved single-particle quantum numbers, together with the symmetry-blocked tensor storage primitives (the rank/scalar variants listed below) and their index-set companion SymmetryBlockedIndexSet.

In this release only the spin axis (\(S_z\)) is populated, supporting restricted (RHF/ROHF) and unrestricted (UHF) references.

Exposed symmetry types are:

Exposed storage types are:

Errors are surfaced as standard Python exceptions mapped from the underlying C++ standard-library exceptions.

class qdk_chemistry.data.symmetry.AxisName

Bases: pybind11_object

Symmetry axis identifier.

Members:

Spin

Spin = <AxisName.Spin: 0>
__init__(self: qdk_chemistry.data.symmetry.AxisName, value: SupportsInt | SupportsIndex) None
AxisName.name -> str
property value
class qdk_chemistry.data.symmetry.SpinValue

Bases: SymmetryAxisValue

Concrete spin-1/2 axis value. The stored value is 2*Ms: +1 for an alpha label, -1 for a beta label.

__init__(self: qdk_chemistry.data.symmetry.SpinValue, two_ms: SupportsInt | SupportsIndex) None

Construct from 2*Ms (e.g. +1 for alpha, -1 for beta).

value(self: qdk_chemistry.data.symmetry.SpinValue) int

The stored 2*Ms value.

class qdk_chemistry.data.symmetry.SymmetryAxis

Bases: DataClass

One named symmetry partition the basis is blocked under.

__init__(self: qdk_chemistry.data.symmetry.SymmetryAxis, name: qdk_chemistry.data.symmetry.AxisName, labels: collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryAxisValue], equivalent: bool) None
admits(self: qdk_chemistry.data.symmetry.SymmetryAxis, value: qdk_chemistry.data.symmetry.SymmetryAxisValue) bool

True iff value is one of this axis’s admissible labels.

equivalent(self: qdk_chemistry.data.symmetry.SymmetryAxis) bool
static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryAxis
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryAxis
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryAxis
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryAxis) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryAxis) str
labels(self: qdk_chemistry.data.symmetry.SymmetryAxis) list[qdk_chemistry.data.symmetry.SymmetryAxisValue]
name(self: qdk_chemistry.data.symmetry.SymmetryAxis) qdk_chemistry.data.symmetry.AxisName
to_file(self: qdk_chemistry.data.symmetry.SymmetryAxis, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryAxis, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryAxis, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryAxisValue

Bases: pybind11_object

Abstract value carried by a single symmetry axis.

__init__(*args, **kwargs)
axis(self: qdk_chemistry.data.symmetry.SymmetryAxisValue) qdk_chemistry.data.symmetry.AxisName

The axis this value belongs to.

class qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet

Bases: DataClass

Immutable set of symmetry-blocked, sorted-unique integer indices, one list per admissible SymmetryLabel of a single SymmetryProduct.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, symmetries: qdk_chemistry.data.symmetry.SymmetryProduct, extents: collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex], indices: collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, collections.abc.Sequence[SupportsInt | SupportsIndex]]) None

Construct from a SymmetryProduct, per-label extents, and per-label index lists (each must be sorted, unique, and in range).

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]

Per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) str
has(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, label: qdk_chemistry.data.symmetry.SymmetryLabel) bool

True iff indices are stored for the given label.

indices(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, label: qdk_chemistry.data.symmetry.SymmetryLabel) tuple

The sorted, unique indices stored for the given label, as an immutable tuple.

labels(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) list[qdk_chemistry.data.symmetry.SymmetryLabel]

The labels for which indices are stored.

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) qdk_chemistry.data.symmetry.SymmetryProduct

The SymmetryProduct this index set is blocked under.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount

Bases: DataClass

Immutable symmetry-blocked scalar. Stores one scalar value per symmetry sector as a map from a per-slot SymmetryLabel to a scalar (e.g. an electron count per spin channel).

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(1)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)'], SupportsInt | SupportsIndex]]) None

Construct from the per-slot symmetry and a list of (labels, value) pairs. A scalar block is a single number, so no extents are required.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(1)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, filename: object) None
value(self: qdk_chemistry.data.symmetry.SymmetryBlockedScalarCount, label: qdk_chemistry.data.symmetry.SymmetryLabel) int

The scalar value stored for the given symmetry label.

class qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4

Bases: DataClass

Immutable rank-4 symmetry-blocked sparse map (double-valued). Each block is a dict-like map from a per-slot local-index tuple to a scalar value.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(4)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(4)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)'], collections.abc.Mapping[Annotated[collections.abc.Sequence[SupportsInt | SupportsIndex], 'FixedSize(4)'], SupportsFloat | SupportsIndex]]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs, where each block is a dict[tuple[int,int,int,int], float]. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) dict

The sparse block stored for the given per-slot labels, as a dict[tuple[int,int,int,int], float].

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(4)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4
get(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)'], idx: Annotated[collections.abc.Sequence[SupportsInt | SupportsIndex], 'FixedSize(4)']) float

Single-entry lookup; returns 0.0 if the entry is absent.

get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) int

Total number of stored blocks (including aliases).

num_entries(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) int

Total number of stored sparse entries across all blocks.

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedSparseMapRank4, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(1)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(1)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)'], Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 1]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(1)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(1)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(1)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)'], Annotated[numpy.typing.ArrayLike, numpy.complex128, '[m, 1]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)']) Annotated[numpy.typing.NDArray[numpy.complex128], '[m, 1]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(1)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(1)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank1Complex, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(2)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(2)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)'], Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, n]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(2)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(2)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(2)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)'], Annotated[numpy.typing.ArrayLike, numpy.complex128, '[m, n]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)']) Annotated[numpy.typing.NDArray[numpy.complex128], '[m, n]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(2)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(2)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank2Complex, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(3)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(3)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)'], Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, n]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(3)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(3)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(3)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)'], Annotated[numpy.typing.ArrayLike, numpy.complex128, '[m, n]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)']) Annotated[numpy.typing.NDArray[numpy.complex128], '[m, n]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(3)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(3)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank3Complex, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(4)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(4)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)'], Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 1]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(4)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex

Bases: DataClass

Immutable symmetry-blocked dense tensor. Stores the non-zero symmetry sectors of a tensor as a map from per-slot SymmetryLabel tuples to dense numpy blocks.

__init__(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, symmetries: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryProduct], 'FixedSize(4)'], extents: Annotated[collections.abc.Sequence[collections.abc.Mapping[qdk_chemistry.data.symmetry.SymmetryLabel, SupportsInt | SupportsIndex]], 'FixedSize(4)'], blocks: collections.abc.Sequence[tuple[Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)'], Annotated[numpy.typing.ArrayLike, numpy.complex128, '[m, 1]']]]) None

Construct from per-slot symmetries, per-slot extents, and a list of (labels, block) pairs. Orbit-equivalent sectors that share the same supplied block are auto-aliased.

block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) Annotated[numpy.typing.NDArray[numpy.complex128], '[m, 1]']

The dense numpy block stored for the given per-slot labels.

extents(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex) Annotated[list[dict[qdk_chemistry.data.symmetry.SymmetryLabel, int]], 'FixedSize(4)']

Per-slot per-label extents.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex) str
has_block(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, labels: Annotated[collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryLabel], 'FixedSize(4)']) bool

True iff a block is stored for the given per-slot labels.

num_blocks(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex) int

Total number of stored blocks (including aliases).

symmetries(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex) list[qdk_chemistry.data.symmetry.SymmetryProduct]

Per-slot SymmetryProduct instances.

to_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryBlockedTensorRank4Complex, filename: object) None
class qdk_chemistry.data.symmetry.SymmetryLabel

Bases: pybind11_object

A composite addressing key: one SymmetryAxisValue per axis.

__init__(self: qdk_chemistry.data.symmetry.SymmetryLabel, values: collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryAxisValue]) None
get(self: qdk_chemistry.data.symmetry.SymmetryLabel, axis: qdk_chemistry.data.symmetry.AxisName) qdk_chemistry.data.symmetry.SymmetryAxisValue

The value carried for the given axis.

has(self: qdk_chemistry.data.symmetry.SymmetryLabel, axis: qdk_chemistry.data.symmetry.AxisName) bool

True iff this label carries a value for the given axis.

class qdk_chemistry.data.symmetry.SymmetryProduct

Bases: DataClass

A SymmetryProduct: the ordered set of axes a basis is blocked under, together with their admissible labels and equivalence flags.

__init__(self: qdk_chemistry.data.symmetry.SymmetryProduct, axes: collections.abc.Sequence[qdk_chemistry.data.symmetry.SymmetryAxis]) None
axes(self: qdk_chemistry.data.symmetry.SymmetryProduct) list[qdk_chemistry.data.symmetry.SymmetryAxis]
axis(self: qdk_chemistry.data.symmetry.SymmetryProduct, name: qdk_chemistry.data.symmetry.AxisName) qdk_chemistry.data.symmetry.SymmetryAxis

Access the axis with the given name.

static from_file(filename: object, type: str) qdk_chemistry.data.symmetry.SymmetryProduct
static from_hdf5_file(filename: object) qdk_chemistry.data.symmetry.SymmetryProduct
static from_json_file(filename: object) qdk_chemistry.data.symmetry.SymmetryProduct
get_data_type_name(self: qdk_chemistry.data.symmetry.SymmetryProduct) str
get_summary(self: qdk_chemistry.data.symmetry.SymmetryProduct) str
has_axis(self: qdk_chemistry.data.symmetry.SymmetryProduct, name: qdk_chemistry.data.symmetry.AxisName) bool

True iff an axis with the given name exists in this SymmetryProduct.

to_file(self: qdk_chemistry.data.symmetry.SymmetryProduct, filename: object, type: str) None
to_hdf5_file(self: qdk_chemistry.data.symmetry.SymmetryProduct, filename: object) None
to_json_file(self: qdk_chemistry.data.symmetry.SymmetryProduct, filename: object) None
qdk_chemistry.data.symmetry.axis_name_to_string(axis: qdk_chemistry.data.symmetry.AxisName) str

Human-readable name for an AxisName.

qdk_chemistry.data.symmetry.spin_index_set(num_modes, alpha, beta, *, equivalent=True)[source]

Build a spin-resolved SymmetryBlockedIndexSet from alpha/beta index lists.

Return type:

SymmetryBlockedIndexSet

Parameters:
  • num_modes (int) – Universe size (total number of orbitals per spin channel).

  • alpha (Sequence[int]) – Sorted active/inactive indices for the alpha channel.

  • beta (Sequence[int]) – Sorted active/inactive indices for the beta channel.

  • equivalent (bool) – Whether the spin axis labels share storage (restricted).

Returns:

A SymmetryBlockedIndexSet carrying the spin symmetry and per-channel indices.