Skip to content

Commit

Permalink
Revert "Update to 1.9.4 (#330)"
Browse files Browse the repository at this point in the history
This reverts commit c57ad61.
  • Loading branch information
kottmanj authored Feb 29, 2024
1 parent c57ad61 commit a8f3692
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 13 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ qulacs # default simulator (best integration), remove if the installation gives
#qibo <= 0.1.1 # can not be installed in the same environment as gpyopt

#optional optimizers
#phoenics # version on PyPi isc urrently broken, we recommend to install from source (AAG github)
#gpyopt # not in combination with qibo as quantum backend

#optional third party libraries
Expand Down
2 changes: 1 addition & 1 deletion src/tequila/apps/adapt/adapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdaptParameters:
degeneracy_threshold: float = 5.e-4
silent: bool = False

def __post_init__(self):
def __post__init__(self):
# avoid stacking of same operator-types in a row
if "method_options" in self.optimizer_args:
if "gtol" in self.optimizer_args["method_options"]:
Expand Down
15 changes: 14 additions & 1 deletion src/tequila/optimizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class _Optimizers:
methods: list = None


SUPPORTED_OPTIMIZERS = ['scipy', 'gpyopt', 'gd']
SUPPORTED_OPTIMIZERS = ['scipy', 'phoenics', 'gpyopt', 'gd']
INSTALLED_OPTIMIZERS = {}
INSTALLED_OPTIMIZERS['scipy'] = _Optimizers(cls=OptimizerSciPy,
minimize=minimize_scipy,
Expand All @@ -37,6 +37,19 @@ class _Optimizers:
except ImportError:
has_gpyopt = False

has_phoenics = False
try:
from tequila.optimizers.optimizer_phoenics import OptimizerPhoenics
from tequila.optimizers.optimizer_phoenics import minimize as minimize_phoenics

INSTALLED_OPTIMIZERS['phoenics'] = _Optimizers(cls=OptimizerPhoenics,
minimize=minimize_phoenics,
methods=OptimizerPhoenics.available_methods())
has_phoenics = True
except ImportError:
has_phoenics = False


def show_available_optimizers(module=None):
"""
Returns
Expand Down
2 changes: 2 additions & 0 deletions src/tequila/optimizers/optimizer_gpyopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import numbers
from tequila.objective.objective import Variable
import warnings

warnings.simplefilter("ignore")
import GPyOpt
from GPyOpt.methods import BayesianOptimization
import numpy as np
Expand Down
Loading

0 comments on commit a8f3692

Please sign in to comment.