GroundStateFinder fails with DeprecationWarning
Hi,
I wanted to try the GroundStateFinder following the tutorial, but the example fails with a DeprecationWarning message. I added the code I used and the full error message below. Do you know what could cause the problem?
Icet Version: 1.3 mip Version: 1.11.0
from ase.build import bulk
from icet import ClusterExpansion, ClusterSpace
from icet.tools.ground_state_finder import GroundStateFinder
prim = bulk('Au')
chemical_symbols = ['Ag', 'Au']
cs = ClusterSpace(prim, cutoffs=[4.3], chemical_symbols=chemical_symbols)
ce = ClusterExpansion(cs, [0, 0, 0.1, -0.02])
structure = prim.repeat(3)
gsf = GroundStateFinder(ce, structure)
ground_state = gsf.get_ground_state({'Ag': 5})
print('Ground state energy:', ce.predict(ground_state))
---------------------------------------------------------------------------
DeprecationWarning Traceback (most recent call last)
<ipython-input-2-8139713c02e3> in <module>
6 structure = prim.repeat(3)
7
----> 8 gsf = GroundStateFinder(ce, structure)
9 ground_state = gsf.get_ground_state({'Ag': 5})
10 print('Ground state energy:', ce.predict(ground_state))
~/.conda/envs/myenv/lib/python3.7/site-packages/icet/tools/ground_state_finder.py in __init__(self, cluster_expansion, structure, solver_name, verbose)
145 if solver_name is None:
146 solver_name = ''
--> 147 self._model = self._build_model(structure, solver_name, verbose)
148
149 # Properties that are defined when searching for a ground state
~/.conda/envs/myenv/lib/python3.7/site-packages/icet/tools/ground_state_finder.py in _build_model(self, structure, solver_name, verbose)
187
188 # The objective function is added to 'model' first
--> 189 model.objective = mip.minimize(mip.xsum(self._get_total_energy(ys)))
190
191 # Connect cluster variables to spin variables with cluster constraints
~/.conda/envs/myenv/lib/python3.7/site-packages/icet/tools/ground_state_finder.py in _get_total_energy(self, cluster_instance_activities)
297 for i in range(len(cluster_instance_activities)):
298 orbit = self._cluster_to_orbit_map[i]
--> 299 E[orbit + 1] += cluster_instance_activities[i]
300 E[0] = 1
301
~/.conda/envs/myenv/lib/python3.7/site-packages/mip/entities.py in __iadd__(self, other)
114 self, other: Union["mip.Var", "mip.LinExpr", numbers.Real],
115 ) -> "mip.LinExpr":
--> 116 raise DeprecationWarning("Inplace operations are deprecated")
117
118 def __sub__(
DeprecationWarning: Inplace operations are deprecated