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

First proposal for the MixedMapper and MixedOp #1188

Draft
wants to merge 75 commits into
base: main
Choose a base branch
from

Conversation

Anthony-Gandon
Copy link
Contributor

@Anthony-Gandon Anthony-Gandon commented May 31, 2023

Summary

Fix #795

This draft PR introduces a MixedOp for manipulating systems corresponding to various "local" Hilbert spaces.
An implementation of the MixedMapper for mapping this operator into a sum of qubit operators acting on the composed registers is also proposed.

Updated tutorial
MixedOpTutorial.zip

@CLAassistant
Copy link

CLAassistant commented Jun 7, 2023

CLA assistant check
All committers have signed the CLA.

@Anthony-Gandon
Copy link
Contributor Author

Anthony-Gandon commented Nov 15, 2023

Update on the status of this PR.

  • The MixedOp was implemented and will probably not change much
  • The MixedMapper was implemented for the typical application to 1 system of Fermions coupled with 1 system of bosons. I still have in mind a generalization to allow for multiple fermionic subsystems.
    See images for the two ways to think of the problem. The first way assumes that we don't need to antisymmetrize the two subsystems
    equation(2)

Anthony-Gandon and others added 13 commits November 17, 2023 19:07
* Formatting error message

An space was missing here as well.

* Space missing

Another space missing.
After reviewing the members of the `qiskit-nature` Github organization
team, the only member without explicit other permissions in this repo
was @stefan-woerner. Based on an offline discussion he agreed that his
ownership and permissions are no longer required which is why I am
removing him from this file. Subsequently, I will also remove the
`qiskit-nature` team from the repository settings since we can rather
add individual members in the future (rather than first adding everyone
to the qiskit-community Github organization and subsequently a single
team; since we will have less overlapping members across multiple
repositories).
In order to deploy the documentation to the public URL, a Github action
needs to be triggered manually. In order to avoid anyone being able to
do this, the script which is being run asserts the username of the
`github.actor` to be in a hard-coded list of authorized users.

This commit updates this list in accordance with the recent CODEOWNER
changes.

I believe, that there must be a better way to handle/restrict access to
who can trigger this action, but for the time being I will simply do
this quick fix.
MarcoBarroca and others added 29 commits March 1, 2024 17:02
* fix pylint errors due to version update

* fix copyright years

* Update qiskit_nature/second_q/operators/bosonic_op.py

---------

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

* Fix copyright
* Add MajoranaOp class

* New style of MajoranaOp.terms(), some new tests

* Update majorana_op.py

* Update majorana_op.py

* Some easier reviews done. More will follow.

* Update releasenotes/notes/add-majoranaop-1cbf9d4a1d4c264e.yaml

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

* Update releasenotes/notes/add-majoranaop-1cbf9d4a1d4c264e.yaml

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

* Update qiskit_nature/second_q/operators/majorana_op.py

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

* Reviewed changes

* final suggestions by mrossinek

* release notes: added example

* suggestions from pylint for tests to pass

* Fixed copyright header for modified files

---------

Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: Steve Wood <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
* Implement ModeBasedMapper no caching

* Added caching and release note

* Update release note to pass spell check

* fix typing

* fix typing for Python <3.10

* suggestions by mrossinek plus changes needed to pass pylint

* Update improve-mappers-b55cb0ca5fd656e4.yaml

---------

Co-authored-by: Steve Wood <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
* Added bosonic log mapper

* Created mapper tests. Fixes in algorithm

* Added annihilation operator tests. Fixes in algo

* Added more unit tests

* Added more unit tests

* Style fixes. Added documentation

* Added release note

* CI fixes

* Further CI fixes

* Apply suggestions from code review

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

* PR fixes

* Style fixes

* Style fix

* Some phrasing from PR review

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

* Refactor of single qubit op mapping

* Added missing unit tests

* Added bosonic log mapper

* Created mapper tests. Fixes in algorithm

* Added annihilation operator tests. Fixes in algo

* Added more unit tests

* Added more unit tests

* Style fixes. Added documentation

* Added release note

* CI fixes

* Further CI fixes

* Apply suggestions from code review

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

* PR fixes

* Style fixes

* Style fix

* Some phrasing from PR review

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

* Refactor of single qubit op mapping

* Added missing unit tests

* Fixed typo

* Doc fixes from code review

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

* Raise error instead of break statement

* Minor fix

---------

Co-authored-by: Max Rossmannek <[email protected]>
…iskit-community#1374)

* Fixed pylint warnings

* Fixed mypy errors

* Fixed errors in tests due to old package networkx

* Copyright and style fixes

* Updated contribution guidelines

* Removed unused type ignore comment

* Added transpiler to pylintdict

* debug macos pipeline

* Test using macos 13

* Test with macos12

* Test setup conda

* Dropped python 3.9 support

* Copyright fix

* Added debug for psi4

* install libecpint for psi4 on ubuntu for python 3.9 and 3.10

* Sintax error fix

* Fixed logic for libecpint installation

* Removed python 3.8 folders

* Fixed mergify yml

* Added release note for python 3.8 drop

* Removed unnecessary package from requirements-decv
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13037067360

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 452 of 494 (91.5%) changed or added relevant lines in 42 files are covered.
  • 81 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.8%) to 85.99%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_nature/second_q/circuit/library/ansatzes/uvcc.py 0 1 0.0%
qiskit_nature/second_q/mappers/bosonic_linear_mapper.py 0 1 0.0%
qiskit_nature/second_q/mappers/mixed_mapper.py 39 40 97.5%
qiskit_nature/second_q/transformers/active_space_transformer.py 0 1 0.0%
qiskit_nature/second_q/mappers/mode_based_mapper.py 43 45 95.56%
qiskit_nature/utils/init.py 3 5 60.0%
qiskit_nature/second_q/circuit/library/ansatzes/ucc.py 4 8 50.0%
qiskit_nature/second_q/operators/symmetric_two_body.py 0 4 0.0%
qiskit_nature/second_q/mappers/bosonic_logarithmic_mapper.py 57 62 91.94%
qiskit_nature/second_q/operators/majorana_op.py 164 174 94.25%
Files with Coverage Reduction New Missed Lines %
qiskit_nature/second_q/drivers/psi4d/psi4driver.py 1 85.0%
qiskit_nature/second_q/drivers/gaussiand/gaussiandriver.py 80 39.5%
Totals Coverage Status
Change from base Build 6873975703: -0.8%
Covered Lines: 8869
Relevant Lines: 10314

💛 - Coveralls

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.

Implement a MixedOperator