Skip to content

Blocks

The Blocks class represents a sum of Block objects stored as a ndarray. It provides methods for simplifying the expression and computing the Hermitian conjugate.


Parameters

  • expr (ndarray[Blocks], optional):

    • A ndarray of Block objects whose sum represents the overall expression.
    • Default: An empty array.
    • Note: During initialization, the array is filtered to remove any zero entries. If more than one block is present, the blocks are automatically simplified using the simplify_blocks() method.
  • subspaces (list[RDBasis], optional):

    • A list of finite RDBasis objects associated with the blocks.
    • Default: None.
    • Usage: This provides context for block operations and is passed to other methods (e.g., during Hermitian conjugation).

      Note: The ordering of the RDBasis objects is important, as it indicates in which order the tensorial products are applied and should match the order of the subspaces in EffectiveFrame.


Attributes

  • expr (ndarray[Blocks], optional):

    • A ndarray of Block objects whose sum represents the overall expression.
  • subspaces (list):

    • A list of finite subspaces associated with the blocks.

Methods

simplify_blocks(self)

Simplifies the block collection by aggregating blocks with the same infinite parts and delta values.

  • Returns:

    • A simplified collection (as a ndarray of Block objects) where blocks sharing the same infinite part (inf) and delta values are combined by summing their finite parts (fin).

hermitian(self)

Computes the Hermitian conjugate of the block collection.

  • Returns:

    • A new Blocks object whose Block objects comprising it are the Hermitian conjugates of the original blocks.

apply_mask(self, expr: Union['MulGroup', 'Expression'])

Applies a mask to a given MulGroup or Expression object based on the Block collection.

  • Parameters:

    • expr (MulGroup or Expression):
      • The expression to which the mask will be applied. The mask is used to determine which parts of the expression are included or excluded.
  • Returns:

    • For a MulGroup:
      • A tuple of two Expression objects:
      • The first expression contains the parts that match the block's delta.
      • The second contains the parts that do not match.
    • For an Expression:
      • Similarly, returns a tuple of two Expression objects separating matching and non-matching parts.

License

SymPT is licensed under the MIT License. See the LICENSE file for details.


Citation

If you use SymPT in your research, please cite the following paper:

BibTeX Entry:

@misc{diotallevi2024symptcomprehensivetoolautomating,
      title={SymPT: a comprehensive tool for automating effective Hamiltonian derivations}, 
      author={Giovanni Francesco Diotallevi and Leander Reascos and Mónica Benito},
      year={2024},
      eprint={2412.10240},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2412.10240}, 
}

APA Citation:

Diotallevi, G. F., Reascos, L., & Benito, M. (2024). SymPT: a comprehensive tool for automating effective Hamiltonian derivations. arXiv preprint arXiv:2412.10240.

IEEE Citation:

G. F. Diotallevi, L. Reascos, and M. Benito, "SymPT: a comprehensive tool for automating effective Hamiltonian derivations," arXiv preprint arXiv:2412.10240, 2024.


References