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

Include the option for imaginary parts in the UCC ansatz #455

Merged
merged 12 commits into from
Apr 26, 2023

Conversation

tanvipg
Copy link
Contributor

@tanvipg tanvipg commented Dec 8, 2021

Summary

A feature added to the ucc.py file to include imaginary contributions to the ucc wave function along with the real parts. To allow for complex values in the Hamiltonian, changes to the 'so_matrix' initiation in the 'two_body_electronic_integrals.py' were added as well.

Details and comments

  1. Added dtype = 'complex' in so_matrix creation in 'two_body_electronic_integrals.py'
  2. Added a boolean flag, 'include_imaginary', in the 'ucc.py' file initialization to include the option of creating the imaginary part of the ucc wavefunction with twice the number of free parameters as described below

Screen Shot 2021-12-07 at 6 29 49 PM

3. Modified the '_build_fermionic_excitation_ops()' in 'ucc.py' file to incorporate the additions described above

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2021

CLA assistant check
All committers have signed the CLA.

@a-matsuo
Copy link
Contributor

I think unittests are required for this new feature since the feature is totally new.

@pbark pbark force-pushed the imaginary_UCCSD branch 2 times, most recently from 44ceb99 to 21a3456 Compare April 14, 2022 12:00
@coveralls
Copy link

coveralls commented May 25, 2022

Pull Request Test Coverage Report for Build 4813358660

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 85.874%

Totals Coverage Status
Change from base Build 4813099706: 0.01%
Covered Lines: 18596
Relevant Lines: 21655

💛 - Coveralls

mrossinek
mrossinek previously approved these changes May 31, 2022
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.

This LGTM now (assuming CI passes). I'll await another review by @pbark or @woodsp-ibm before merging 👍

@woodsp-ibm woodsp-ibm marked this pull request as draft June 1, 2022 17:02
@woodsp-ibm woodsp-ibm added this to the 0.5 milestone Jun 1, 2022
@mrossinek mrossinek removed the request for review from pbark June 29, 2022 15:27
@HuangJunye HuangJunye added the Community PR PRs from contributors that are not 'members' of the Qiskit organization label Jun 30, 2022
@woodsp-ibm woodsp-ibm removed the Community PR PRs from contributors that are not 'members' of the Qiskit organization label Jun 30, 2022
@mrossinek mrossinek removed this from the 0.5.0 milestone Oct 7, 2022
@mrossinek mrossinek added the on hold Can not fix yet label Oct 19, 2022
@mrossinek
Copy link
Member

With complex integrals no longer being an issue in the stack (see also #1144), I have updated this PR to the latest changes.
I am not confident that the proposed inclusion of this feature in the SUCCD case will work as intended since this was applied to the code version prior to the addition of the mirror feature in #729. Thus, I refrained from exposing this keyword argument in that specific subclass in this PR.

@mrossinek mrossinek removed the on hold Can not fix yet label Apr 26, 2023
@mrossinek mrossinek marked this pull request as ready for review April 26, 2023 21:05
@mrossinek mrossinek merged commit 92deb28 into qiskit-community:main Apr 26, 2023
Anthony-Gandon pushed a commit to Anthony-Gandon/qiskit-nature that referenced this pull request May 25, 2023
…unity#455)

* included the option for imaginary parts to ucc

* fix sign

* fix black

* Added unittest for imaginary component

* Run black

* Fix spelling, lint

* Update qiskit_nature/circuit/library/ansatzes/ucc.py

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

* Add include_imaginary arg. to subclasses of UCC

* Patch the UCC excitation_list when `include_imaginary is True`.

This ensures that the HFInitialPoint array has the correct shape.

* Update qiskit_nature/properties/second_quantization/electronic/integrals/two_body_electronic_integrals.py

* Update ucc_imaginary-8d7d9c3322899a34.yaml

* Migrate proposed changes to new code location

---------

Co-authored-by: Panagiotis Barkoutsos <[email protected]>
Co-authored-by: Marc Sanz Drudis <[email protected]>
Co-authored-by: Matthew Treinish <[email protected]>
Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
Co-authored-by: Declan Millar <[email protected]>
Co-authored-by: Max Rossmannek <[email protected]>
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.