Skip to content

Apply Commutation Relations

Overview

The Apply Commutation Relations module provides functions to apply predefined commutation rules to expressions containing infinite-dimensional operators. These functions systematically substitute operators using a given set of commutation relations, ensuring proper simplification and reordering.


apply_substituitions(expr, subs)

This function applies commutation relations (or other substitutions) to the infinite part of an Expression. It iterates over each MulGroup in the Expression and updates the infinite part by applying the given substitution rules until no further changes occur.

Parameters

  • expr (Expression):
    The symbolic expression to which the substitutions should be applied.

  • subs (dict):
    A dictionary mapping expressions to their replacements. This is typically a set of commutation relations.

Returns

  • Expression:
    A new expression with the commutation relations applied.

Example Usage

substitution_rules = {
    A*B: C  # Example AB = C
}
new_expr = apply_substituitions(old_expr, substitution_rules)

apply_commutation_relations(expr, commutation_relations)

A convenience function that calls apply_substituitions, specifically for applying commutation relations.

Parameters

  • expr (Expression):
    The expression to which commutation relations should be applied.
  • commutation_relations (dict):
    A dictionary containing commutator substitutions.

Returns

  • Expression:
    A new expression with commutation relations applied.

Example Usage

commutation_relations = {
    A * B - B * A: C  # Example commutator
}
new_expr = apply_commutation_relations(old_expr, commutation_relations)
This is functionally equivalent to:
new_expr = apply_substituitions(old_expr, commutation_relations)


extract_ns(expr, structure)

This function creates the commutation relations for each bosonic subspace needed to extract the number operators of a given expression.

Parameters

  • expr (Expression):
    The expression from which the number operators should be extracted.
  • structure (dict):
    A mapping of bosonic subspaces to indices indicated by the number operator.

Returns

  • Tuple (Expression, dict):
    • The transformed expression with extracted number operators.
    • A dictionary containing the commutation relations used for extraction.

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