Skip to content

Add Term, Terms and TermSet- mirrors Pauli closely#32

Merged
geo-chri merged 7 commits into
fermion-integrationfrom
feat/fermion-term-types
May 29, 2026
Merged

Add Term, Terms and TermSet- mirrors Pauli closely#32
geo-chri merged 7 commits into
fermion-integrationfrom
feat/fermion-term-types

Conversation

@geo-chri
Copy link
Copy Markdown
Collaborator

@geo-chri geo-chri commented May 5, 2026

This is part 1 of ~6 PRs covering issue 21

@geo-chri geo-chri marked this pull request as ready for review May 6, 2026 13:28
@geo-chri
Copy link
Copy Markdown
Collaborator Author

geo-chri commented May 6, 2026

This is scaffolding. Multiplication, conjugation, sparse-string constructors, and per-component construction methods are deferred to follow-up PRs — they need fermion product/normal-ordering infrastructure that doesn’t exist yet. The empty marker traits (AsView, AsViewMut) are placeholders that PR 2 will hang real methods on without requiring downstream code to change its imports.

@obackhouse
Copy link
Copy Markdown
Collaborator

is this cmpnt major?

@geo-chri geo-chri requested a review from matt-ryley-Quant May 22, 2026 12:09
Comment thread zixy/src/fermion/operator/cmpnt_major/terms.rs
Comment thread zixy/src/fermion/operator/cmpnt_major/term.rs
Comment thread zixy/src/fermion/operator/cmpnt_major/term.rs
Comment thread zixy/src/fermion/operator/terms.rs Outdated
Comment thread zixy/src/fermion/operator/cmpnt_major/terms.rs
@geo-chri geo-chri changed the base branch from develop to fermion-integration May 28, 2026 08:44
@geo-chri
Copy link
Copy Markdown
Collaborator Author

is this cmpnt major?

yes, creation operators in are_part and annihilation in ann_part

@obackhouse
Copy link
Copy Markdown
Collaborator

is this cmpnt major?

yes, creation operators in are_part and annihilation in ann_part

should it be in a directory to indicate that like with qubits? or is there no equivalent distinction?

@geo-chri
Copy link
Copy Markdown
Collaborator Author

geo-chri commented May 28, 2026

is this cmpnt major?

yes, creation operators in are_part and annihilation in ann_part

should it be in a directory to indicate that like with qubits? or is there no equivalent distinction?

Now I see your point. Fermions have component-major inline in the flat fermion/operator. Should we organise into cmpnt_major and leave mode_majer for later if needed? I thought to keep it flat for now since we are scaffolding and not have the need for mode_major

@obackhouse
Copy link
Copy Markdown
Collaborator

is this cmpnt major?

yes, creation operators in are_part and annihilation in ann_part

should it be in a directory to indicate that like with qubits? or is there no equivalent distinction?

Now I see your point. Fermions have component-major inline in the flat fermion/operator. Should we organise into cmpnt_major and leave mode_majer for later if needed? I thought to keep it flat for now since we are scaffolding and not have the need for mode_major

yea i'd probably match the layout? up to you though

@geo-chri
Copy link
Copy Markdown
Collaborator Author

is this cmpnt major?

yes, creation operators in are_part and annihilation in ann_part

should it be in a directory to indicate that like with qubits? or is there no equivalent distinction?

Now I see your point. Fermions have component-major inline in the flat fermion/operator. Should we organise into cmpnt_major and leave mode_majer for later if needed? I thought to keep it flat for now since we are scaffolding and not have the need for mode_major

yea i'd probably match the layout? up to you though

makes sense, I will move things to cmpnt_major to stay consistent with Pauli


#[test]
fn test_new_has_one_term() {
let term = Term::<Unity>::new(Modes::from_count(4));
Copy link
Copy Markdown

@matt-ryley-Quant matt-ryley-Quant May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a test or two here for different term types and check the coeff has been set to unit value.

Copy link
Copy Markdown

@matt-ryley-Quant matt-ryley-Quant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one minor comment regarding adding more tests.

Thanks for this!

@geo-chri
Copy link
Copy Markdown
Collaborator Author

Approved with one minor comment regarding adding more tests.

Thanks for this!

Good point! I will add the tests

@geo-chri geo-chri merged commit f81ffc3 into fermion-integration May 29, 2026
4 checks passed
@geo-chri geo-chri deleted the feat/fermion-term-types branch May 29, 2026 11:18
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