qlinks.local_structure package#
qlinks.local_structure contains neutral local algebra used by both caging
and open-system workflows. The package owns constrained-basis local reduced
density matrices, local pattern-operator embedding, and matrix-unit expansion.
It deliberately has no dependency on either research layer.
Submodules#
qlinks.local_structure.reduced_density module#
Local reduced-density-matrix primitives for constrained bases.
This module is intentionally neutral: both caging diagnostics and open-system construction may depend on it, while it must not depend on either layer.
- class qlinks.local_structure.reduced_density.LocalReducedDensityMatrix(variable_indices, local_patterns, density_matrix, eigenvalues, support_basis, null_basis)[source]#
Bases:
objectReduced density matrix of a pure state or subspace on selected variables.
- __init__(variable_indices, local_patterns, density_matrix, eigenvalues, support_basis, null_basis)#
- qlinks.local_structure.reduced_density.local_reduced_density_matrix_from_state(*, basis_configs, state, variable_indices, tolerance=1e-10)[source]#
Compute the local RDM of a state represented in a constrained basis.
- qlinks.local_structure.reduced_density.local_reduced_density_matrix_from_state_matrix(*, basis_configs, states, variable_indices, tolerance=1e-10)[source]#
Compute the local RDM of the normalized projector onto a state subspace.
statesmay have shape(dim, n_states)or(n_states, dim). The columns are orthonormalized before tracing out the environment, so callers may pass linearly dependent representatives without changing local support.
qlinks.local_structure.embedding module#
Embedding of local pattern operators into constrained Hilbert spaces.
qlinks.local_structure.matrix_units module#
Local matrix-unit representations shared by caging and open-system code.
- class qlinks.local_structure.matrix_units.LocalMatrixUnitTerm(coefficient, target_pattern, source_pattern)[source]#
Bases:
objectOne local matrix-unit term
coefficient * |target><source|.- __init__(coefficient, target_pattern, source_pattern)#
Module contents#
Neutral local-structure primitives shared by research layers.
The public names here describe local algebra and constrained-basis structure; they carry no caging- or Lindblad-specific semantics. Higher-level research layers should depend on these primitives rather than on each other.
- class qlinks.local_structure.LocalMatrixUnitTerm(coefficient, target_pattern, source_pattern)[source]#
Bases:
objectOne local matrix-unit term
coefficient * |target><source|.- __init__(coefficient, target_pattern, source_pattern)#
- class qlinks.local_structure.LocalReducedDensityMatrix(variable_indices, local_patterns, density_matrix, eigenvalues, support_basis, null_basis)[source]#
Bases:
objectReduced density matrix of a pure state or subspace on selected variables.
- __init__(variable_indices, local_patterns, density_matrix, eigenvalues, support_basis, null_basis)#
- qlinks.local_structure.embed_local_pattern_operator(*, basis_configs, variable_indices, local_patterns, local_operator)[source]#
Embed a local operator into the constrained full basis.
- qlinks.local_structure.local_operator_matrix_unit_expansion(*, local_patterns, local_operator, tolerance=1e-10)[source]#
Expand a local operator into matrix-unit terms.
- qlinks.local_structure.local_rank_one_matrix_unit_expansion(*, local_patterns, alpha, beta, tolerance=1e-10)[source]#
Expand
|alpha><beta|into local matrix units|a><b|.
- qlinks.local_structure.local_reduced_density_matrix_from_state(*, basis_configs, state, variable_indices, tolerance=1e-10)[source]#
Compute the local RDM of a state represented in a constrained basis.
- qlinks.local_structure.local_reduced_density_matrix_from_state_matrix(*, basis_configs, states, variable_indices, tolerance=1e-10)[source]#
Compute the local RDM of the normalized projector onto a state subspace.
statesmay have shape(dim, n_states)or(n_states, dim). The columns are orthonormalized before tracing out the environment, so callers may pass linearly dependent representatives without changing local support.