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 Slater determinant and fermionic Gaussian state initial states #483

Merged
merged 69 commits into from
May 20, 2022

Conversation

kevinsung
Copy link
Contributor

Summary

Fixes #459 . Comes after #462 and #482.

Details and comments

I made the following changes to the pylint rules:

  • Increased allowed function name length to 50 in order to accommodate the name _prepare_fermionic_gaussian_state_jordan_wigner
  • Added p to the list of allowed variables since it is a common name for an index or number.

Let me know if this is not acceptable.

@woodsp-ibm
Copy link
Member

The pylint rules are common throughout qiskit and hence we should try and find variable names etc that fit within the current rules rather than changing the rules.

@kevinsung
Copy link
Contributor Author

Very well. I reverted the pylint rules, and instead disabled the checks for the violating lines by adding comments.

@woodsp-ibm
Copy link
Member

Very well. I reverted the pylint rules, and instead disabled the checks for the violating lines by adding comments.

Ok, it would be more acceptable though to choose names etc within the rules rather than disabling them to skirt the rules. Having to disable an exceptional case where pylint is having trouble but things are as needed does happen, but disabling the rule inline should not be the norm here.

@kevinsung kevinsung force-pushed the slater-determinants branch 2 times, most recently from 2fbe7a2 to eec6b8a Compare January 7, 2022 14:35
@kevinsung kevinsung changed the title [After #462, #482] Add Slater determinant and fermionic Gaussian state initial states [After #482] Add Slater determinant and fermionic Gaussian state initial states Jan 13, 2022
@kevinsung kevinsung force-pushed the slater-determinants branch 2 times, most recently from 07e4abf to 0359113 Compare January 14, 2022 14:01
Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

Just some minor comments. I assume you will refactor #482 according to our offline discussion so I am holding off with reviewing that PR

@kevinsung kevinsung force-pushed the slater-determinants branch 3 times, most recently from ee2876e to 085fd70 Compare February 9, 2022 13:55
@kevinsung
Copy link
Contributor Author

@woodsp-ibm I've addressed your comments.

@kevinsung
Copy link
Contributor Author

test failures seem unrelated

Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

Other than this final nitpicky comment, I think this is good to go! Thanks a lot, @kevinsung!

@mrossinek mrossinek requested a review from woodsp-ibm May 19, 2022 06:52
@mrossinek mrossinek dismissed their stale review May 19, 2022 06:53

Changes were implemented

@kevinsung
Copy link
Contributor Author

@mrossinek I addressed one of your comments and wasn't sure how to address the other. Please take a look.

Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

I hope this makes things clearer

@kevinsung
Copy link
Contributor Author

@mrossinek I disagree with your suggestions because they make it seem like the creation and annihilation operators are independent of each other. I think the set notation {a_j} should only include one or the other, not both.

@kevinsung
Copy link
Contributor Author

Specifically, the notation {a_j, a_j^\dagger} makes it appear that a_j^\dagger is an independent symbol rather than simply the hermitian conjugate of a_j.

@mrossinek
Copy link
Member

In that case, please make it consistent whether you define the creation or annihilation set because right now you define a_j but later you define b_j^\dagger

@kevinsung
Copy link
Contributor Author

@mrossinek Done.

Copy link
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

I'd say this lgtm now. @woodsp-ibm please also take a look 👍

@kevinsung
Copy link
Contributor Author

@mrossinek Since it looks good to you, could you please approve it? You just left a comment without actually approving it.

@mergify mergify bot merged commit 762fc0c into qiskit-community:main May 20, 2022
@kevinsung kevinsung deleted the slater-determinants branch May 20, 2022 18:01
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this pull request May 25, 2023
…iskit-community#483)

* add QuadraticHamiltonian class

* preparation of Slater determinants and fermionic Gaussian states

* validate input

* expose _fermionic_op as to_fermionic_op

* use tuple labels and merge loops

* update docs

* add num_modes argument

* document new errors

* add num_modes property

* update doc

* spelling

* mypy

* from __future__ import annotations

* add release note

* trigger CI

* fix spelling

* update terra

* split so each class has own file

* fix comments and error messages, don't name registers

* revert library init description

* run copyright check

* add release note

* spelling

* spelling and docs

* make private functions hidden again

* mypy

* improve docs and error messages

* split test file

* add input validation

* mypy

* lint

* add slater determinants test file

* create utils module

* test unsupported mappers fail gracefully

* fix imports

* raise NotImplementedError for unsupported mapper

* improve docs

* rewrite documentation

* improve docs and error messages

* factor out validation function

* improve slater determinant docs

* add tutorial notebook

* typo

* fix warning in notebook

* edit notebook

* comma

* spelling and format

* add note to QuadraticHamiltonian class

* Update docs/tutorials/11_quadratic_hamiltonian_and_slater_determinants.ipynb

Co-authored-by: Max Rossmannek <[email protected]>

* add hyperlinks

* update print output in notebook

* Update releasenotes/notes/slater-53415163fff84313.yaml

Co-authored-by: Steve Wood <[email protected]>

* format

* edit notebook kernel to satisfy CI

* edit notebook

* edit notebook to say creation instead of annihilation

Co-authored-by: Panagiotis Barkoutsos <[email protected]>
Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: Steve Wood <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preparation of Slater determinants and fermionic Gaussian states
5 participants