Skip to content

Commit

Permalink
Update orbital_optimizer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JdelArco98 authored Jan 7, 2025
1 parent 71c5cc2 commit 55de8df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tequila/quantumchemistry/orbital_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ def kernel(self, h1, h2, *args, **kwargs):
vqe_solver_arguments = self.vqe_solver_arguments
result = self.vqe_solver(H=H, circuit=self.circuit, molecule=molecule, **vqe_solver_arguments)
if hasattr(self.vqe_solver, "compute_rdms"):
self.rdm1,self.rdm2 = self.vqe_solver.compute_rdms(U=self.circuit, variables=result.variables, molecule=molecule, use_hcb=restrict_to_hcb)
rdm1,rdm2 = self.vqe_solver.compute_rdms(U=self.circuit, variables=result.variables, molecule=molecule, use_hcb=restrict_to_hcb)
rdm2 = self.reorder(rdm2, 'dirac', 'mulliken')
elif self.circuit is None:
raise Exception("Orbital Optimizer: Either provide a callable vqe_solver or a circuit")
else:
Expand Down

0 comments on commit 55de8df

Please sign in to comment.