IMSRG.commutators

Module to evaluate the commutators of the IMSRG.

Functions

antisymmetrize_2b(a2)

Fully antisymmetrizes a two-body operator with respect to both pairs of indices

antisymmetrize_2b_pq(a2)

Antisymmetrizes a two-body operator with respect to the first two indices (pq)

antisymmetrize_2b_rs(a2)

Antisymmetrizes a two-body operator with respect to the last two indices (rs)

evaluate_comm_110(occs, a1, b1)

Evaluates the [1,1]->0 commutator contribution

evaluate_comm_111(occs, a1, b1)

Evaluates the [1,1]->1 commutator contribution

evaluate_comm_121(occs, a1, b2)

Evaluates the [1,2]->1 commutator contribution

evaluate_comm_122(occs, a1, b2)

Evaluates the [1,2]->2 commutator contribution

evaluate_comm_220(occs, a2, b2)

Evaluates the [2,2]->0 commutator contribution

evaluate_comm_221(occs, a2, b2)

Evaluates the [2,2]->1 commutator contribution using optimized implementation

evaluate_comm_222(occs, a2, b2)

Evaluates the complete [2,2]->2 commutator contribution

evaluate_comm_222_ph(occs, a2, b2)

Evaluates the particle-hole contribution to the [2,2]->2 commutator

evaluate_comm_222_pphh(occs, a2, b2)

Evaluates the particle-particle hole-hole contribution to the [2,2]->2 commutator

evaluate_imsrg2_commutator(occs, a1, a2, b1, b2)

Evaluates the complete commutator for IMSRG(2) flow equations

IMSRG.commutators.antisymmetrize_2b_pq(a2)

Antisymmetrizes a two-body operator with respect to the first two indices (pq)

Applies the antisymmetrization A_{pq} = 1/2(1 - P_{pq}) where P_{pq} exchanges indices p and q

Parameters:

a2 (numpy array) – Two-body matrix elements with indices pqrs

Returns:

Partially antisymmetrized two-body matrix elements

Return type:

numpy array

IMSRG.commutators.antisymmetrize_2b_rs(a2)

Antisymmetrizes a two-body operator with respect to the last two indices (rs)

Applies the antisymmetrization A_{rs} = 1/2(1 - P_{rs}) where P_{rs} exchanges indices r and s

Parameters:

a2 (numpy array) – Two-body matrix elements with indices pqrs

Returns:

Partially antisymmetrized two-body matrix elements

Return type:

numpy array

IMSRG.commutators.antisymmetrize_2b(a2)

Fully antisymmetrizes a two-body operator with respect to both pairs of indices

Applies complete antisymmetrization to both bra and ket indices, equivalent to A_{pq}A_{rs} acting on the operator

Parameters:

a2 (numpy array) – Two-body matrix elements with indices pqrs

Returns:

Fully antisymmetrized two-body matrix elements

Return type:

numpy array

IMSRG.commutators.evaluate_comm_110(occs, a1, b1)

Evaluates the [1,1]->0 commutator contribution

Computes the scalar (0-body) part of the commutator between two one-body operators

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a1 (numpy array) – First one-body operator

  • b1 (numpy array) – Second one-body operator

Returns:

Scalar commutator contribution

Return type:

float

IMSRG.commutators.evaluate_comm_111(occs, a1, b1)

Evaluates the [1,1]->1 commutator contribution

Computes the one-body part of the commutator between two one-body operators

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a1 (numpy array) – First one-body operator

  • b1 (numpy array) – Second one-body operator

Returns:

One-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_121(occs, a1, b2)

Evaluates the [1,2]->1 commutator contribution

Computes the one-body part of the commutator between a one-body and two-body operator

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a1 (numpy array) – One-body operator

  • b2 (numpy array) – Two-body operator

Returns:

One-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_122(occs, a1, b2)

Evaluates the [1,2]->2 commutator contribution

Computes the two-body part of the commutator between a one-body and two-body operator

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a1 (numpy array) – One-body operator

  • b2 (numpy array) – Two-body operator

Returns:

Two-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_220(occs, a2, b2)

Evaluates the [2,2]->0 commutator contribution

Computes the scalar (0-body) part of the commutator between two two-body operators

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

Scalar commutator contribution

Return type:

float

IMSRG.commutators.__evaluate_comm_221_naive(occs, a2, b2)

Evaluates the [2,2]->1 commutator contribution using naive implementation

Computes the one-body part of the commutator between two two-body operators using a straightforward but potentially less efficient contraction pattern

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

One-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_221(occs, a2, b2)

Evaluates the [2,2]->1 commutator contribution using optimized implementation

Computes the one-body part of the commutator between two two-body operators. This implementation pre-computes tensors contracted with occupation numbers for improved efficiency

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

One-body commutator contribution

Return type:

numpy array

IMSRG.commutators.__evaluate_comm_222_naive(occs, a2, b2)

Evaluates the [2,2]->2 commutator contribution using naive implementation

Computes the two-body part of the commutator between two two-body operators using a straightforward contraction approach that may be less computationally efficient

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

Two-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_222_pphh(occs, a2, b2)

Evaluates the particle-particle hole-hole contribution to the [2,2]->2 commutator

Computes the specific part of the two-body commutator involving contractions between particle-particle and hole-hole index pairs

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

Particle-particle hole-hole commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_222_ph(occs, a2, b2)

Evaluates the particle-hole contribution to the [2,2]->2 commutator

Computes the specific part of the two-body commutator involving contractions between particle-hole index pairs with proper antisymmetrization

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

Particle-hole commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_comm_222(occs, a2, b2)

Evaluates the complete [2,2]->2 commutator contribution

Computes the full two-body part of the commutator between two two-body operators by combining particle-particle hole-hole and particle-hole contributions

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a2 (numpy array) – First two-body operator

  • b2 (numpy array) – Second two-body operator

Returns:

Complete two-body commutator contribution

Return type:

numpy array

IMSRG.commutators.evaluate_imsrg2_commutator(occs, a1, a2, b1, b2)

Evaluates the complete commutator for IMSRG(2) flow equations

Computes all IMSRG(2) contributions to the commutator C = [A, B] where A and B each contain one- and two-body parts, returning the 0-body, 1-body, and 2-body contributions to the result C

Parameters:
  • occs (numpy array) – Occupation numbers for each single-particle state

  • a1 (numpy array) – One-body part of first operator

  • a2 (numpy array) – Two-body part of first operator

  • b1 (numpy array) – One-body part of second operator

  • b2 (numpy array) – Two-body part of second operator

Returns:

Zero-body, one-body, and two-body commutator contributions

Return type:

float, numpy array, numpy array