Skip to content

Revise fix for integration tests#473

Merged
Krzmbrzl merged 2 commits intoValeevGroup:masterfrom
Krzmbrzl:fix-integration-tests
Feb 2, 2026
Merged

Revise fix for integration tests#473
Krzmbrzl merged 2 commits intoValeevGroup:masterfrom
Krzmbrzl:fix-integration-tests

Conversation

@Krzmbrzl
Copy link
Collaborator

@Krzmbrzl Krzmbrzl commented Feb 1, 2026

This (effectively) reverts 445eeae as we
do indeed want the semantics to be such that symmetrizers need to be
constructed with swapped bra/ket indices compared to what
external_indices(…) returns. The underlying issue in the integration
tests was that external_indices was called on the symmetrizer alone
rather than the entire expression, in which case it currently has the
opposite behavior in terms of bra/ket ordering.

Hence, the correct way to fix the integration tests is to use
external_indices in the way it was intended to be used and leave the
construction of the symmetrizer tensors as it was.

See also #471

This (effectively) revers 445eeae as we
do indeed want the semantics to be such that symmetrizers need to be
constructed with swapped bra/ket indices compared to what
external_indices(…) returns. The underlying issue in the integration
tests was that external_indices was called on the symmetrizer alone
rather than the entire expression, in which case it currently has the
opposite behavior in terms of bra/ket ordering.

Hence, the correct way to fix the integration tests is to use
external_indices in the way it was intended to be used and leave the
construction of the symmetrizer tensors as it was.

See also ValeevGroup#471
@Krzmbrzl Krzmbrzl requested a review from ABesharat February 1, 2026 09:17
@evaleev
Copy link
Member

evaleev commented Feb 2, 2026

@Krzmbrzl this is fine, but points out the flaw with what external_indices returns currently. Bra/ket/aux are properties of slots, not indices. Now, you may think that each external index should only appear in 1 slot, and indeed only in such situations external_indices makes sense. What we want this function to return, however, would be {index,slot} pairs, the latter would allow us to support aux slots, and would make get_{bra,ket}_idx safer/cleaner.

@Krzmbrzl
Copy link
Collaborator Author

Krzmbrzl commented Feb 2, 2026

What we want this function to return, however, would be {index,slot} pairs, the latter would allow us to support aux slots, and would make get_{bra,ket}_idx safer/cleaner.

So you mean something like { "i_1", Slot::Bra}?

Sounds like an excellent idea 👍

@Krzmbrzl Krzmbrzl force-pushed the fix-integration-tests branch from 45ecc4a to 5d6c905 Compare February 2, 2026 08:08
@Krzmbrzl Krzmbrzl merged commit 51cfde9 into ValeevGroup:master Feb 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants