3838from qiskit .opflow .gradients import GradientBase
3939from qiskit .utils .validation import validate_min
4040from qiskit .utils .backend_utils import is_aer_provider
41- from qiskit .utils .deprecation import deprecate_function
4241from qiskit .utils import QuantumInstance , algorithm_globals
4342from ..optimizers import Optimizer , SLSQP
4443from ..variational_algorithm import VariationalAlgorithm , VariationalResult
@@ -648,51 +647,6 @@ def energy_evaluation(parameters):
648647
649648 return energy_evaluation
650649
651- @deprecate_function (
652- """
653- The VQE.get_optimal_cost method is deprecated as of Qiskit Terra 0.18.0
654- and will be removed no sooner than 3 months after the releasedate.
655- This information is part of the returned result object and can be
656- queried as VQEResult.eigenvalue."""
657- )
658- def get_optimal_cost (self ) -> float :
659- """Get the minimal cost or energy found by the VQE."""
660- if self ._ret .optimal_point is None :
661- raise AlgorithmError (
662- "Cannot return optimal cost before running the algorithm to find optimal params."
663- )
664- return self ._ret .optimal_value
665-
666- @deprecate_function (
667- """
668- The VQE.get_optimal_circuit method is deprecated as of Qiskit Terra
669- 0.18.0 and will be removed no sooner than 3 months after the releasedate.
670- This information is part of the returned result object and can be
671- queried as VQEResult.ansatz.bind_parameters(VQEResult.optimal_point)."""
672- )
673- def get_optimal_circuit (self ) -> QuantumCircuit :
674- """Get the circuit with the optimal parameters."""
675- if self ._ret .optimal_point is None :
676- raise AlgorithmError (
677- "Cannot find optimal circuit before running the algorithm to find optimal params."
678- )
679- return self .ansatz .assign_parameters (self ._ret .optimal_parameters )
680-
681- @deprecate_function (
682- """
683- The VQE.get_optimal_vector method is deprecated as of Qiskit Terra 0.18.0
684- and will be removed no sooner than 3 months after the releasedate.
685- This information is part of the returned result object and can be
686- queried as VQEResult.eigenvector."""
687- )
688- def get_optimal_vector (self ) -> Union [List [float ], Dict [str , int ]]:
689- """Get the simulation outcome of the optimal circuit."""
690- if self ._ret .optimal_parameters is None :
691- raise AlgorithmError (
692- "Cannot find optimal circuit before running the algorithm to find optimal vector."
693- )
694- return self ._get_eigenstate (self ._ret .optimal_parameters )
695-
696650 def _get_eigenstate (self , optimal_parameters ) -> Union [List [float ], Dict [str , int ]]:
697651 """Get the simulation outcome of the ansatz, provided with parameters."""
698652 optimal_circuit = self .ansatz .bind_parameters (optimal_parameters )
@@ -704,20 +658,6 @@ def _get_eigenstate(self, optimal_parameters) -> Union[List[float], Dict[str, in
704658
705659 return state
706660
707- @property
708- @deprecate_function (
709- """
710- The VQE.optimal_params property is deprecated as of Qiskit Terra 0.18.0
711- and will be removed no sooner than 3 months after the releasedate.
712- This information is part of the returned result object and can be
713- queried as VQEResult.optimal_point."""
714- )
715- def optimal_params (self ) -> np .ndarray :
716- """The optimal parameters for the ansatz."""
717- if self ._ret .optimal_point is None :
718- raise AlgorithmError ("Cannot find optimal params before running the algorithm." )
719- return self ._ret .optimal_point
720-
721661
722662class VQEResult (VariationalResult , MinimumEigensolverResult ):
723663 """VQE Result."""
0 commit comments