Skip to content

Commit 64746db

Browse files
authored
Bug in orbital_optimizer.py to vqe_solver (#377)
* Bug in orbital_optimizer.py to vqe_solver
1 parent c5d51d6 commit 64746db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tequila/quantumchemistry/orbital_optimizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ def kernel(self, h1, h2, *args, **kwargs):
217217
vqe_solver_arguments = self.vqe_solver_arguments
218218
result = self.vqe_solver(H=H, circuit=self.circuit, molecule=molecule, **vqe_solver_arguments)
219219
if hasattr(self.vqe_solver, "compute_rdms"):
220-
rdm1, rdm2 = self.vqe_solver.compute_rdms(U=self.circuit, variables=result.variables, molecule=molecule, use_hcb=restrict_to_hcb)
220+
rdm1,rdm2 = self.vqe_solver.compute_rdms(U=self.circuit, variables=result.variables, molecule=molecule, use_hcb=restrict_to_hcb)
221+
rdm2 = self.reorder(rdm2, 'dirac', 'mulliken')
221222
elif self.circuit is None:
222223
raise Exception("Orbital Optimizer: Either provide a callable vqe_solver or a circuit")
223224
else:

0 commit comments

Comments
 (0)