Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lattice class and transverse-field Ising Hamiltonian #6106

Merged
merged 40 commits into from
Aug 22, 2024

Conversation

ddhawan11
Copy link
Contributor

@ddhawan11 ddhawan11 commented Aug 15, 2024

Context:
Add spin Hamiltonian functions to PennyLane.

Description of the Change:
Adds a new class to generate lattice object, which is further used to generate spin Hamiltonians.

Benefits:
Users can easily generate spin Hamiltonians.

[sc-70982]

@ddhawan11 ddhawan11 requested a review from soranjh August 15, 2024 17:14
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (1f55c88) to head (ad9dc4c).
Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6106      +/-   ##
==========================================
- Coverage   99.67%   99.65%   -0.02%     
==========================================
  Files         432      435       +3     
  Lines       41839    41845       +6     
==========================================
- Hits        41702    41701       -1     
- Misses        137      144       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @ddhawan11, left some preliminary comments.

pennylane/spin/__init__.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
tests/spin/test_lattice_shapes.py Outdated Show resolved Hide resolved
tests/spin/test_lattice_shapes.py Outdated Show resolved Hide resolved
tests/spin/test_spin_hamiltonian.py Outdated Show resolved Hide resolved
ddhawan11 and others added 2 commits August 19, 2024 12:28
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
@ddhawan11 ddhawan11 changed the title [WIP] Add Spin hamiltonians Add Lattice class and transverse-field Ising Hamiltonian Aug 19, 2024
@ddhawan11
Copy link
Contributor Author

[sc-70982]

Copy link
Contributor

@obliviateandsurrender obliviateandsurrender left a comment

Choose a reason for hiding this comment

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

Good work @ddhawan11! Leaving the first set of comments.

pennylane/spin/__init__.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice_shapes.py Outdated Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Outdated Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Outdated Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Outdated Show resolved Hide resolved
ddhawan11 and others added 7 commits August 20, 2024 07:07
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
@ddhawan11 ddhawan11 marked this pull request as ready for review August 20, 2024 17:17
pennylane/spin/lattice.py Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
tests/spin/test_spin_hamiltonian.py Outdated Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Show resolved Hide resolved
tests/spin/test_lattice.py Show resolved Hide resolved
tests/spin/test_lattice.py Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
ddhawan11 and others added 4 commits August 21, 2024 02:48
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
pennylane/spin/lattice.py Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
ddhawan11 and others added 4 commits August 21, 2024 11:30
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender left a comment

Choose a reason for hiding this comment

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

Given that CI passes all the checks and @soranjh will be satisfied with the docs, should be good to go from my end!

Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @ddhawan11, looks good to go. Just pushed some minor doc fixes and added a few final comments and questions.

pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/lattice.py Outdated Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Show resolved Hide resolved
pennylane/spin/spin_hamiltonian.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Outdated Show resolved Hide resolved
tests/spin/test_lattice.py Show resolved Hide resolved
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @ddhawan11, looks good to me.

@ddhawan11 ddhawan11 merged commit 3646d80 into master Aug 22, 2024
40 checks passed
@ddhawan11 ddhawan11 deleted the spin_hamiltonian branch August 22, 2024 14:20
mudit2812 pushed a commit that referenced this pull request Sep 10, 2024
**Context:**
Add spin Hamiltonian functions to PennyLane.

**Description of the Change:**
Adds a new class to generate lattice object, which is further used to
generate spin Hamiltonians.

**Benefits:**
Users can easily generate spin Hamiltonians.

[sc-70982]

---------

Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Co-authored-by: soranjh <soran.jahangiri@gmail.com>
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