Significant changes in this release:
- Enable support for Python 3.11, 3.12, 3.13 and 3.14.
- Drop support for Python 3.6 and 3.7.
- It is now possible to define new algebras by extending the base class
expression.Generator. This functionality has been documented in the API reference, and a new example has been added. - New auxiliary type
expression.LinearFunctionGenthat is used to define commutation relations and simplification rules for user-defined algebras. - The property
expression.Generator.algebra_idhas been turned into a method. - Added methods
__copy__()and__deepcopy__()to a few mutable objects:expression.Monomial,expression.Expression[R|C],
loperator.HilbertSpaceandloperator.SpacePartition. - New read-only attribute
loperator.ElementarySpace.dimalso inherited byloperator.ESpace(Fermion|Boson|Spin). - Dimension of
loperator.ESpaceBosonhad to be a power of 2. Now this restriction is lifted. Arguments of its constructor and of
loperator.make_space_boson()have been adjusted accordingly: They now expect the dimension argumentdiminstead of its binary logarithmn_bits. - Constructors of
loperator.HilbertSpaceare changed to accept the argumentdim_bosoninstead of its binary logarithmbits_per_boson. - New read-only attribute
loperator.HilbertSpace.is_sparsethat isTrueif some of the constituent elementary spaces have non-power-of-two dimensions (see also the discussion about the sparse Hilbert spaces in libcommute's online documentation). - New read-only attribute
loperator.HilbertSpace.vec_sizethat is equal to the minimal size of a state vector container compatible with this Hilbert space. - Semantics of the existing attribute
loperator.HilbertSpace.dimhas been changed. Now it is equal to the exact dimension of the Hilbert space, which is smaller thanloperator.HilbertSpace.vec_sizeif the Hilbert space is sparse. - New method
loperator.HilbertSpace.es_dim(es)that returns dimension of a constituent elementary space. - New method
loperator.HilbertSpace.foreach_elementary_space(f)that applies a given function to each constituent elementary space. - New classes
CompressedStateView(R|C). These objects areLOperator(R|C)-compatible views that perform basis state index translation from a (possibly) sparse Hilbert space of dimensiondimto the continuous range[0; dim-1]. - Methods
loperator.SpacePartition.merge_subspaces()andloperator.SpacePartition.find_connections()no longer accept thehsargument and instead use theloperator.HilbertSpaceobject provided upon construction. setup.pyhas been updated to look for the libcommute header files in thesrc/libcommutesubdirectory of pycommute's source tree in addition to the location specified via theLIBCOMMUTE_INCLUDEDIRenvironment variable. This change makes it easier to distribute both libraries in one archive.