Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Ground state interface #1288

Merged
merged 201 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
7baf769
Merge pull request #2 from Qiskit/master
May 28, 2020
3d6a27a
Merge branch 'master' of github.com:qiskit/qiskit-aqua
pbark Sep 14, 2020
0562cd7
ground state min eigensolver interface
pbark Sep 14, 2020
9460c4c
fix small things style
pbark Sep 14, 2020
dd86427
added the molecule object with the right properties
pbark Sep 16, 2020
f12e88f
minor fix molecule
pbark Sep 16, 2020
0faa09c
excited state calculation added
pbark Sep 16, 2020
c1525bd
EOMvqe added
pbark Sep 16, 2020
7f7d8b8
ground state interface minimum eigensolver
Sep 17, 2020
362843b
Add MinimumEigensolver interface to VQEAdapt
mrossinek Sep 17, 2020
199c97b
Implement the AdaptVQEGroundStateCalculation class
mrossinek Sep 17, 2020
d82e76e
comments
stefan-woerner Sep 18, 2020
e0cd53c
initial bopes sampler
Sep 18, 2020
f9d27c0
fermionic transformation working
Sep 21, 2020
d10f5f1
naming
Sep 21, 2020
a83e354
compute eigenvalue MinEigensolver works
Sep 21, 2020
e73d4aa
return raw results until I make the GroundStateResult
Sep 21, 2020
1b45a92
now the fermionic transformation returns a molecular ground state res…
Sep 21, 2020
1019641
added TODOs
Sep 21, 2020
65ec2cc
rename GSC files
Cryoris Sep 22, 2020
98756e2
add init to qubit_transformations
Cryoris Sep 22, 2020
945ec04
fix lint in bosonic_trafo and qubit_op_trafo
Cryoris Sep 22, 2020
cd0b613
update (MES)GSC to new structure
Cryoris Sep 22, 2020
00cf578
rm empty orbital optimization file
Cryoris Sep 22, 2020
1c6105d
Fix init
mrossinek Sep 24, 2020
5d193f6
Implement returns_groundstate and fix some lints
mrossinek Sep 24, 2020
bd65fff
Rewrite AdaptVQEGSCalc. deriving from MESGSCalc.
mrossinek Sep 24, 2020
90c5f60
Add TODO about deprecating qiskit.chemistry.algorithms module
mrossinek Sep 24, 2020
9049480
Revert "Add MinimumEigensolver interface to VQEAdapt"
mrossinek Sep 24, 2020
6876b67
Merge branch 'master' into refactor-interfaces-dev
mrossinek Sep 24, 2020
3045616
Properly deprecate VQEAdapt
mrossinek Sep 24, 2020
5b85722
Port VQEAdapt to AdaptVQE (based on a GroundStateCalculation)
mrossinek Sep 24, 2020
cc03798
Some minor corrections/updates
mrossinek Sep 24, 2020
d8b5f07
Rename AdaptVQE files
mrossinek Sep 24, 2020
c60bc56
Add optional custom_excitation_pool argument to AdaptVQE computation …
mrossinek Sep 24, 2020
dce955a
Work on FermionicTransformation and related objs
Cryoris Sep 28, 2020
80efb85
Merge branch 'refactor-interfaces-dev' of github.com:pbark/qiskit-aqu…
Cryoris Sep 28, 2020
2f80943
Merge branch 'master' into interfaces_dev
Cryoris Sep 28, 2020
d918f03
Merge branch 'interfaces_dev' into refactor-interfaces-dev
Cryoris Sep 28, 2020
c629783
Merge pull request #4 from pbark/refactor-interfaces-dev
pbark Sep 28, 2020
46b4c5d
documentation added
Sep 28, 2020
ec1d697
fixes in ground state
Sep 28, 2020
1133cb1
patch MES result to GSC result instead of returning a tuple
Cryoris Sep 29, 2020
4b881c1
Merge branch 'interfaces_dev' into ground_state_interface
Sep 29, 2020
f24c35d
Merge branch 'master' into interfaces_dev
Sep 29, 2020
ca4aa17
Merge branch 'interfaces_dev' of github.com:pbark/qiskit-aqua into in…
Sep 29, 2020
7ac5ac4
Merge branch 'interfaces_dev' into ground_state_interface
Sep 29, 2020
e3d9bf4
files fixes for GSC interface
Sep 29, 2020
03d6c30
rm utf8 headers
Cryoris Sep 29, 2020
72b2716
fix spell, lint, mypy
manoelmarques Sep 29, 2020
c631ccd
Merge branch 'master' into ground_state_interface
Sep 29, 2020
0ee83fa
Remove `custom_excitation_pool` from AdaptVQE `compute_ground_state` …
mrossinek Sep 29, 2020
66e74b8
fix mypy
manoelmarques Sep 29, 2020
1f42a6c
fix lint
manoelmarques Sep 29, 2020
cde79fc
Re-enable DeprecationWarnings after VQEAdapt has been initialized
mrossinek Sep 30, 2020
74e26ea
Fixes several minor nit-picks
mrossinek Sep 30, 2020
eb97fb7
make MESFactory an interface only
Cryoris Sep 30, 2020
346f28d
fix copyright years
Cryoris Sep 30, 2020
0e5abdd
derive from MESFactory and update docs
Cryoris Sep 30, 2020
c93c4fa
update docstrings and add molecule_info
Cryoris Sep 30, 2020
d97c224
consistent naming in ``ground(_)state``
Cryoris Sep 30, 2020
1534184
fix spell
Sep 30, 2020
0d1d523
more spell, deprecate MGSE
Sep 30, 2020
229af18
fix deprecation
Sep 30, 2020
3d0a728
more style
Sep 30, 2020
c67567a
test fixes
Sep 30, 2020
6d3d254
fixes
Sep 30, 2020
60d89d3
Merge branch 'master' into ground_state_interface
Sep 30, 2020
36d0045
[WIP] basic Result-interfaces
mrossinek Sep 30, 2020
f67079a
Remove BosonicTransformation from this PR
mrossinek Sep 30, 2020
f5b177d
AdaptVQE actually supports aux_operators
mrossinek Sep 30, 2020
71bdbd6
[wip] resolve cyclic import problems
mrossinek Sep 30, 2020
c1c9dfa
Make AdaptVQE use the FermionicGSResult
mrossinek Sep 30, 2020
1d9413a
Use FermionicGroundStateResult in MinimumEigensolverGroundStateCalcul…
mrossinek Sep 30, 2020
1f0da50
Fix mypy
mrossinek Sep 30, 2020
e751b79
Filter DeprecationWarnings in unittests
mrossinek Sep 30, 2020
85c97d0
Add TODO in AdaptVQE unittest
mrossinek Sep 30, 2020
dd6bbb3
Add missing unittest imports
mrossinek Sep 30, 2020
04ff1ff
mypy fix
adekusar-drl Sep 30, 2020
388c999
Merge branch 'ground_state_interface' of https://github.com/pbark/qis…
adekusar-drl Sep 30, 2020
3aebb4d
Merge branch 'master' into ground_state_interface
Cryoris Oct 1, 2020
5e23835
unused code
adekusar-drl Oct 1, 2020
05e10c9
Merge remote-tracking branch 'pbark/ground_state_interface' into grou…
adekusar-drl Oct 1, 2020
fee3206
Merge branch 'master' into ground_state_interface
adekusar-drl Oct 1, 2020
affac21
Create qiskit.chemistry.results module
mrossinek Oct 1, 2020
df8d717
Replace interpret() with add_context() in QubitOperatorTransformations
mrossinek Oct 1, 2020
7a8f1cd
Fix GroundStateCalculation classes to work with the results interface
mrossinek Oct 1, 2020
a07d36f
Revert faulty change in github workflow
mrossinek Oct 1, 2020
f0c0c98
Merge branch 'master' into ground_state_interface
manoelmarques Oct 2, 2020
e842598
Merge branch 'master' into ground_state_interface
manoelmarques Oct 2, 2020
3de3c90
unitests WIP first commit
Oct 5, 2020
6800911
remove deprecation suppressing from new tests
Oct 5, 2020
a5704bd
support additional aux ops and conv to dict
Cryoris Oct 6, 2020
c2cd78b
fix aux_ops=None
Cryoris Oct 6, 2020
9070c6e
lint, style
adekusar-drl Oct 6, 2020
699751b
more test
Oct 6, 2020
f82a78a
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 6, 2020
d72be75
fixes in test
Oct 6, 2020
ac6db57
fix style
manoelmarques Oct 6, 2020
250b3d9
Merge branch 'master' into ground_state_interface
manoelmarques Oct 6, 2020
4bc6404
fix mypy
manoelmarques Oct 6, 2020
b3bc18d
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
manoelmarques Oct 6, 2020
f5f1914
fix mypy
manoelmarques Oct 6, 2020
74ce025
fixes in fermionic trafo
Oct 6, 2020
9021533
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 6, 2020
39a3214
Merge branch 'master' into ground_state_interface
manoelmarques Oct 6, 2020
b727562
remove editor created redundant file
Oct 7, 2020
dc6f853
resolved tests
Oct 7, 2020
cc49925
docstring fix
Oct 7, 2020
371c7e1
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 7, 2020
37f71f8
fix error & specify type hint
Cryoris Oct 7, 2020
e9188bf
Merge branch 'ground_state_interface' into aux_operators
Cryoris Oct 7, 2020
b9da2bf
change typehint Any -> FermionicOp
Cryoris Oct 7, 2020
534de13
add missing imports
Cryoris Oct 7, 2020
37e54b3
spell
Oct 7, 2020
65fbe05
suggestions from code review
Cryoris Oct 7, 2020
e8b78f1
consistent use in .keys()
Cryoris Oct 7, 2020
5cf7702
type hints, minor improvements
adekusar-drl Oct 7, 2020
19b704a
Rethink the qiskit.chemistry.results
mrossinek Oct 7, 2020
7361c90
Remove unneeded DeprecationWarning from AdaptVQEResult
mrossinek Oct 7, 2020
a877e98
Update some docstrings
mrossinek Oct 7, 2020
a127cf3
fix lint
manoelmarques Oct 7, 2020
af6a9b8
revert back to lists of aux_ops
Cryoris Oct 7, 2020
3343861
Merge branch 'ground_state_interface' into aux_operators
Cryoris Oct 7, 2020
d08d750
Update qiskit/chemistry/ground_state_calculation/adapt_vqe.py
Cryoris Oct 8, 2020
7d5799a
apply suggestions from code review
Cryoris Oct 8, 2020
e41cd60
Merge branch 'aux_operators' of github.com:Cryoris/qiskit-aqua into a…
Cryoris Oct 8, 2020
d0f39e8
change typehint to List[float]
Cryoris Oct 8, 2020
a15326d
Merge pull request #5 from Cryoris/aux_operators
pbark Oct 8, 2020
b56b1b5
Update qiskit/chemistry/core/hamiltonian.py
Cryoris Oct 8, 2020
5a5f1be
test fixes after code review
Oct 8, 2020
bbbbbd4
test fixes after code review
Oct 8, 2020
33da63a
Merge branch 'master' into ground_state_interface
manoelmarques Oct 8, 2020
63196b5
Rename aux_values to aux_operator_eigenvalues
mrossinek Oct 8, 2020
fb916b4
Remove leftover from dict-style aux_operators
mrossinek Oct 8, 2020
e3fc416
Add an `evaluate_operators` method to the GroundStateCalculation
mrossinek Oct 8, 2020
ebae7aa
Merge branch 'master' into ground_state_interface
manoelmarques Oct 8, 2020
842ca9c
fix lint
manoelmarques Oct 8, 2020
d9f5ba1
Merge branch 'master' into ground_state_interface
manoelmarques Oct 8, 2020
783a0e4
Remove erronous TODO
mrossinek Oct 9, 2020
acdd705
Enforce a FermionicTransformation in the VQEUCCSDFactory
mrossinek Oct 9, 2020
7ab4a39
Do not enforce VQEUCCSDFactory type in AdaptVQE
mrossinek Oct 9, 2020
960ec95
Reuse the VQE object during AdaptVQE
mrossinek Oct 9, 2020
0f28076
Expose molecule_info and qubit_mapping publicly
mrossinek Oct 9, 2020
9cf0327
fix lint
manoelmarques Oct 9, 2020
26d7362
Merge branch 'master' into ground_state_interface
manoelmarques Oct 9, 2020
b7eeb75
Merge branch 'master' into ground_state_interface
manoelmarques Oct 9, 2020
13e6e42
Merge branch 'master' into ground_state_interface
manoelmarques Oct 10, 2020
1444474
fixes in tests
Oct 12, 2020
db1ad81
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 12, 2020
b0e877b
fixes in tests and revert to molecule_methods
Oct 12, 2020
26d0105
remove two duplicate tests
Oct 12, 2020
e95c509
Merge branch 'master' into ground_state_interface
manoelmarques Oct 12, 2020
97a3933
Expose some VQE arguments in the VQEUCCSDFactory
mrossinek Oct 12, 2020
4c9e903
Merge branch 'master' into ground_state_interface
manoelmarques Oct 12, 2020
b0d100d
fix spell
manoelmarques Oct 12, 2020
20b3bcf
reverted due to missing part of the test uccsd_HF
Oct 12, 2020
1e2679b
remove test EOM todos
Oct 12, 2020
6da9700
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 12, 2020
8bae6ea
lint
Oct 12, 2020
0c9b39c
more lint
Oct 12, 2020
f8233ba
more lint
Oct 12, 2020
a9698d5
Prepare EigenstateResult to handle ground and excited states
mrossinek Oct 13, 2020
8cc1d6b
Deprecate the Enums in the chemistry.core module
mrossinek Oct 13, 2020
fa7f436
Also populate eigenstates in ground state calculations
mrossinek Oct 13, 2020
1622eb8
Add factory for NumPyMinimumEigensolver
mrossinek Oct 13, 2020
7ed6508
Implement `_filter_criterion` in FermionicTransformation
mrossinek Oct 13, 2020
dfcdb7a
Extract default filter_criterion into interface
mrossinek Oct 13, 2020
634538f
Make use of default filter criterion configurable
mrossinek Oct 13, 2020
ce3e3fb
Check state's type before making at a StateFn
mrossinek Oct 13, 2020
fdfb057
Use `supports_aux_ops` in `returns_groundstate`
mrossinek Oct 13, 2020
43382e2
Replace Any type-hint where not really necessary
mrossinek Oct 13, 2020
ec268ab
Do not use legacy Operator in new interface
mrossinek Oct 13, 2020
2bce4e6
Except (Minimum)EigensolverResults in interpret()
mrossinek Oct 13, 2020
f10e41f
Fix tests to work with OperatorBase rather than WeightedPauliOperator
mrossinek Oct 13, 2020
850c799
rm WPO support in trafo, add test for aux_ops
Cryoris Oct 14, 2020
1df361d
Fix docstring
mrossinek Oct 14, 2020
946682c
Fix aux_op particle-hole conversion
mrossinek Oct 14, 2020
a9af92a
Merge branch 'master' into ground_state_interface
manoelmarques Oct 14, 2020
3ec6cf9
added reno
Oct 14, 2020
947567b
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 14, 2020
176fdfb
initial OOVQE commit
Brogis1 Oct 14, 2020
cc35b24
minor fixes
Brogis1 Oct 14, 2020
25da57e
fix style
adekusar-drl Oct 14, 2020
a4adf1b
Merge pull request #6 from pbark/gsi_oovqe
pbark Oct 14, 2020
8a1fe42
renaming
manoelmarques Oct 14, 2020
58d3581
Merge branch 'master' into ground_state_interface
manoelmarques Oct 14, 2020
6316193
Merge branch 'master' into ground_state_interface
manoelmarques Oct 14, 2020
386c435
typo in the properties
adekusar-drl Oct 14, 2020
4e435a8
fixes in OOVQE
adekusar-drl Oct 14, 2020
578333e
update reno
Oct 14, 2020
85d5594
update reno2
Oct 14, 2020
ba21131
update reno 3
Oct 14, 2020
e25fb6f
fix spell
manoelmarques Oct 14, 2020
83e952e
Merge branch 'master' into ground_state_interface
manoelmarques Oct 14, 2020
de7ff10
moving oovqe to a separate PR
Oct 14, 2020
be4d237
Merge branch 'ground_state_interface' of github.com:pbark/qiskit-aqua…
Oct 14, 2020
8a5a49a
Merge branch 'master' into ground_state_interface
Cryoris Oct 14, 2020
41b1892
fix mypy
manoelmarques Oct 14, 2020
25972e0
Update qiskit/chemistry/algorithms/ground_state_solvers/minimum_eigen…
manoelmarques Oct 14, 2020
a3ccb85
fix spell
manoelmarques Oct 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@


class VQEAdapt(VQAlgorithm):
"""
The Adaptive VQE algorithm.
"""DEPRECATED. The Adaptive VQE algorithm.

See https://arxiv.org/abs/1812.11173
"""
Expand Down Expand Up @@ -73,6 +72,10 @@ def __init__(self, operator: LegacyBaseOperator,
ValueError: if var_form_base is not an instance of UCCSD.
See also: qiskit/chemistry/components/variational_forms/uccsd_adapt.py
"""
warnings.warn('The qiskit.chemistry.algorithms.minimum_eigen_solvers.VQEAdapt object is '
'deprecated as of 0.8.0 and will be removed no sooner than 3 months after the'
' release. You should use qiskit.chemistry.ground_state_calculation.AdaptVQE '
'instead.', DeprecationWarning, stacklevel=2)
validate_min('threshold', threshold, 1e-15)
validate_min('delta', delta, 1e-5)
super().__init__(var_form=var_form_base,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

""" Molecular ground state energy chemistry application """

import warnings
from typing import List, Optional, Callable, Union

from qiskit.providers import BaseBackend
Expand Down Expand Up @@ -59,6 +60,11 @@ def __init__(self,
See also :class:`~qiskit.chemistry.core.Hamiltonian` which has the core
processing behind this class.
"""

warnings.warn('The MolecularGroundStateEnergy class is deprecated as of Qiskit Aqua 0.8.0 '
'and will be removed no earlier than 3 months after the release date. '
'Instead, the GroundStateCalculation class can be used.',
DeprecationWarning, stacklevel=2)
self._driver = driver
self._solver = solver
self._transformation = transformation
Expand Down
24 changes: 13 additions & 11 deletions qiskit/chemistry/components/variational_forms/uccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self,
excitation_type=self._excitation_type,)

self._hopping_ops, self._num_parameters = self._build_hopping_operators()
self._excitation_pool = None
self._excitation_pool = None # type: Optional[List[WeightedPauliOperator]]
self._bounds = [(-np.pi, np.pi) for _ in range(self._num_parameters)]

self._logging_construct_circuit = True
Expand Down Expand Up @@ -226,14 +226,15 @@ def double_excitations(self):
return self._double_excitations

@property
def excitation_pool(self):
"""
Getter of full list of available excitations (called the pool)
Returns:
list[WeightedPauliOperator]: excitation pool
"""
def excitation_pool(self) -> List[WeightedPauliOperator]:
"""Returns the full list of available excitations (called the pool)."""
return self._excitation_pool

@excitation_pool.setter
def excitation_pool(self, excitation_pool: List[WeightedPauliOperator]) -> None:
"""Sets the excitation pool."""
self._excitation_pool = excitation_pool.copy()

def _build_hopping_operators(self):
if logger.isEnabledFor(logging.DEBUG):
TextProgressBar(sys.stderr)
Expand Down Expand Up @@ -328,8 +329,9 @@ def manage_hopping_operators(self):
hopping operators in a so called "excitation pool" and clears the previous list to be empty.
Furthermore, the depth is asserted to be 1 which is required by the Adaptive VQE algorithm.
"""
# store full list of excitations as pool
self._excitation_pool = self._hopping_ops.copy()
if self._excitation_pool is None:
# store full list of excitations as pool
self._excitation_pool = self._hopping_ops.copy()

# check depth parameter
if self._reps != 1:
Expand All @@ -339,8 +341,8 @@ def manage_hopping_operators(self):

# reset internal excitation list to be empty
self._hopping_ops = []
self._num_parameters = len(self._hopping_ops) * self._reps
self._bounds = [(-np.pi, np.pi) for _ in range(self._num_parameters)]
self._num_parameters = 0
self._bounds = []

def push_hopping_operator(self, excitation):
"""
Expand Down
25 changes: 24 additions & 1 deletion qiskit/chemistry/core/chemistry_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
Such an operator takes a QMolecule and produces an input for
a quantum algorithm
"""

from abc import ABC, abstractmethod
import warnings
import logging
from typing import Union, List, Tuple, Optional, cast
from typing import Dict, Union, List, Tuple, Optional, cast
import numpy as np

from qiskit.aqua.algorithms import MinimumEigensolverResult, EigensolverResult, AlgorithmResult
Expand All @@ -43,6 +45,10 @@ class ChemistryOperator(ABC):

@abstractmethod
def __init__(self):
warnings.warn('The ChemistryOperator is deprecated as of Qiskit Aqua 0.8.0 and will be '
'removed no earlier than 3 months after the release date. Instead, the '
'FermionicTransformation can be used to transform QMolecules and construct '
'ground state result objects.', DeprecationWarning, stacklevel=2)
self._molecule_info = {}

@abstractmethod
Cryoris marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -105,6 +111,13 @@ class MolecularChemistryResult(AlgorithmResult):
Energies are in Hartree and dipole moments in A.U unless otherwise stated.
"""

def __init__(self, a_dict: Optional[Dict] = None) -> None:
super().__init__(a_dict)
warnings.warn('The qiskit.chemistry.chemistry_operator.MolecularChemistryResult object is '
'deprecated as of 0.8.0 and will be removed no sooner than 3 months after the'
' release. You should use qiskit.chemistry.ground_state_calculation.'
'FermionicGroundStateResult instead.', DeprecationWarning, stacklevel=2)

@property
def algorithm_result(self) -> AlgorithmResult:
""" Returns raw algorithm result """
Expand Down Expand Up @@ -153,6 +166,16 @@ class MolecularGroundStateResult(MolecularChemistryResult):
Energies are in Hartree and dipole moments in A.U unless otherwise stated.
"""

# TODO we need to be able to extract the statevector or the optimal parameters that can
mrossinek marked this conversation as resolved.
Show resolved Hide resolved
# construct the circuit of the GS from here (if the algorithm supports this)
mrossinek marked this conversation as resolved.
Show resolved Hide resolved

def __init__(self, a_dict: Optional[Dict] = None) -> None:
super().__init__(a_dict)
warnings.warn('The qiskit.chemistry.chemistry_operator.MolecularGroundStateResult object '
'is deprecated as of 0.8.0 and will be removed no sooner than 3 months after '
'the release. You should use qiskit.chemistry.ground_state_calculation.'
'FermionicGroundStateResult instead.', DeprecationWarning, stacklevel=2)

@property
def energy(self) -> Optional[float]:
""" Returns ground state energy if nuclear_repulsion_energy is available from driver """
Expand Down
11 changes: 8 additions & 3 deletions qiskit/chemistry/core/hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
energy of the electrons and nuclei in a molecule.
"""
import warnings
from typing import Optional, List, Union, cast
from typing import Optional, List, Union, cast, Tuple
import logging
from enum import Enum

Expand Down Expand Up @@ -82,6 +82,9 @@ def __init__(self,
Raises:
QiskitChemistryError: Invalid symmetry reduction
"""
warnings.warn('The Hamiltonian class is deprecated as of Qiskit Aqua 0.8.0 and will be '
'removed no earlier than 3 months after the release date. Instead, the '
'FermionicTransformation can be used.', DeprecationWarning, stacklevel=2)
transformation = transformation.value
qubit_mapping = qubit_mapping.value
orbital_reduction = orbital_reduction if orbital_reduction is not None else []
Expand Down Expand Up @@ -114,7 +117,8 @@ def __init__(self,
self._ph_y_dipole_shift = 0.0
self._ph_z_dipole_shift = 0.0

def run(self, qmolecule):
def run(self, qmolecule: QMolecule) -> Tuple[WeightedPauliOperator, WeightedPauliOperator]:
Cryoris marked this conversation as resolved.
Show resolved Hide resolved
""" run method"""
logger.debug('Processing started...')
# Save these values for later combination with the quantum computation result
self._hf_energy = qmolecule.hf_energy
Expand Down Expand Up @@ -155,7 +159,8 @@ def run(self, qmolecule):
if orbitals_list:
orbitals_list = np.array(orbitals_list)
orbitals_list = \
orbitals_list[(orbitals_list >= 0) & (orbitals_list < qmolecule.num_orbitals)]
orbitals_list[(cast(np.ndarray, orbitals_list) >= 0) &
(orbitals_list < qmolecule.num_orbitals)]

freeze_list_alpha = [i for i in orbitals_list if i < num_alpha]
freeze_list_beta = [i for i in orbitals_list if i < num_beta]
Expand Down
25 changes: 25 additions & 0 deletions qiskit/chemistry/ground_state_calculation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Ground state calculation algorithms."""

from .ground_state_calculation import GroundStateCalculation
from .adapt_vqe import AdaptVQE
from .mes_ground_state_calculation import MinimumEigensolverGroundStateCalculation
from .mes_factories import MESFactory, VQEUCCSDFactory

__all__ = ['GroundStateCalculation',
Cryoris marked this conversation as resolved.
Show resolved Hide resolved
'AdaptVQE',
'MinimumEigensolverGroundStateCalculation',
'MESFactory',
mrossinek marked this conversation as resolved.
Show resolved Hide resolved
'VQEUCCSDFactory'
]
Loading