I’m running a DFT geometry optimization using the python api and I’m getting an error with the matmul
function after 1 or 2 steps have elapsed. This is the full output of the error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[17], line 1
----> some wrapper code.....
File ~/miniforge3/envs/autodock/lib/python3.11/site-packages/psi4/driver/driver.py:1270, in optimize(name, **kwargs)
1268 opt_object.molsys.geom = molecule.geometry().np
1269 core.print_out(opt_object.pre_step_str()) # print optking's molecule
-> 1270 opt_object.compute() # process E, gX, H
1271 try:
1272 opt_object.take_step()
File ~/miniforge3/envs/autodock/lib/python3.11/site-packages/optking/opt_helper.py:167, in Helper.compute(self)
164 logger.debug("Molecular system after make_internal_coords:")
165 logger.info(str(self.molsys))
--> 167 self._compute()
168 logger.info("\n\t%s", print_geom_grad(self.geom, self.gX))
File ~/miniforge3/envs/autodock/lib/python3.11/site-packages/optking/opt_helper.py:448, in CustomHelper._compute(self)
446 self.fq, self._Hq = self.molsys.apply_external_forces(self.fq, self._Hq)
447 self._Hq = self.history.hessian_update(self._Hq, self.fq, self.molsys)
--> 448 self.fq, self._Hq = self.molsys.project_redundancies_and_constraints(self.fq, self._Hq)
449 else:
450 result = self.computer.compute(self.geom, driver="hessian")
File ~/miniforge3/envs/autodock/lib/python3.11/site-packages/optking/molsys.py:855, in Molsys.project_redundancies_and_constraints(self, fq, H, small_val_limit)
847 logger.debug(
848 "\n\tInternal forces in au, after projection of redundancies"
849 + " and constraints.\n"
850 + print_array_string(fq)
851 )
852 # Project redundancies out of Hessian matrix.
853 # Peng, Ayala, Schlegel, JCC 1996 give H -> PHP + 1000(1-P)
854 # The second term appears unnecessary and sometimes messes up Hessian updating.
--> 855 H_new = P @ H @ P
856 # H += 1000 * (1 - P)
857
858 # The above projection of constraints shouldn't automatically remove external and ranged
859 # coordinates from the forces (sometimes it should) but we should remove these coordinates from
860 # the hessian. These coordinates are not updated in the hessian update but this makes
861 # sure that the projection doesn't add coupling constants involving frozen coordinates
863 ranged = self.ranged_intco_list
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 105 is different from 106)
This is the molecule I’m running:
units Angstrom
0 1
--
0 1
C 1.610189797246078 5.638412555718483 6.510204138739465
C 1.582273053068075 4.483789765750354 5.936184969594862
C 1.544917361476212 3.312676400758558 5.322326396507169
C 1.540280232822572 2.178035125137026 4.786370919419078
C 1.362524597869940 1.110023554703237 3.926502543719522
C 0.361187456892468 0.957806582460314 2.956755515573951
C -0.501495585565250 0.795204048160053 2.107979581714264
C -1.359992576628117 0.764289844751807 0.980912452753212
O -2.316870844893498 1.453830255350657 0.706981560055367
N -0.961871037621042 -0.288100874122568 0.060413230243548
C -0.785988384674436 -0.756288249467537 -1.008142829584434
C -0.452311769488470 -1.427634206804757 -2.191769526087685
O 0.632290403295888 -2.147171526369247 -2.225316497895026
B 0.830040950401831 -2.733754243552631 -3.687338119996683
O 1.812811023185939 -3.450498215285791 -3.988158456434470
C -0.457721014905926 -2.131799526210990 -4.408347431851494
C -1.107943238531224 -2.110336509493784 -5.598230805202152
C -2.203359359525979 -1.531530319462471 -5.941574040906362
C -2.746295751256861 -0.865640154626955 -4.927739137216317
C -2.425998037545653 -0.664617086946754 -3.698593226941317
C -1.220269486648242 -1.330565924371908 -3.407180036342778
N 2.677777371365757 0.252088500746651 3.589565962161560
N 1.992623733289669 -0.298543937050343 4.385614219511968
Any ideas?