Closed julenl closed 1 year ago
Besides the fact that, when both spin registers (alpha and beta) are fully occupied, UCCSD is not really going to give you an improved result, I agree that the exception logic around this could be improved a bit. Especially, since this failure also occurs when e.g. only the alpha spin register is completely filled while the beta-spin is not. I ran into the past and in such cases simply disabled the check because the code works fine (for when at least the beta-spin is not fully occupied).
Sidenote: I disabled the check by removing the private method which runs the check from the class instance (i.e. by overwriting it with a lambda function which always returns True
)
I tried removing the "=" from the ">=" for ucc, but then the operator turns for some reason into a list at some point and crashes.
The "problem" is, that a filled register leads to empty lists of excitations which might need to be handled differently in pieces of the code. But that should not be difficult to fix.
Would you be interested in opening a PR which includes the following?
I'll be more than happy to try, but I will need some assistance.
Environment
What is happening?
Trying to run a UCC calculation on noble gas dimmers does not seem to work.
How can we reproduce the issue?
Returns:
What should happen?
The ansatz should work also for fully occupied orbitals.
Any suggestions?
I have noticed that there is some incoherence between two similar validations:
if any(n >= self.num_spatial_orbitals for n in self.num_particles):
if any(n > self.num_spatial_orbitals for n in self.num_particles):
The text on the second one says "greater than or equal" but the condition only has a ">", and it works. But the ucc one says "greater than" and the condition is ">=", so it does not work for any noble gas.
I tried removing the "=" from the ">=" for ucc, but then the operator turns for some reason into a list at some point and crashes.