goodchemistryco / Tangelo

A python package for exploring end-to-end chemistry workflows on quantum computers and simulators.
https://goodchemistryco.github.io/Tangelo/
Other
99 stars 27 forks source link

Singlet symmetry-reduced UCCSD #366

Open JamesB-1qbit opened 7 months ago

JamesB-1qbit commented 7 months ago

Utilizes symmetry to reduce the number of parameters for singlet UCCSD. Also generates the variables

param_dict. Maps the parameter indice to the corresponding spatial orbital excitation param_dict[0] = (2, 0) means that parameter 1 is utilized for the single excitation (2^0 - 0^2) + (3 ^1 - 1^ 3) for example.

operator_dict maps the excitation to the FermionOperator.

params2keep is the list of parameters from the full packed_amplitudes that are kept in the optimization process. This could be modified by the user if some excitations are known to be small.

ValentinS4t1qbit commented 6 months ago

Do you see this feature as:

alexfleury-sb commented 6 months ago

@ValentinS4t1qbit I think the first point summarize it better, but there is more to it. The forbidden excitations have parameter set to 0 (they are ignored) if the orbital symmetry rule is not totally symmetric (A1).

Therefore the excitations on spin orbitals mapping to the same spatial orbitals are linearly dependant + we can remove excitations we know the parameter will be 0 even after optimization.

ValentinS4t1qbit commented 6 months ago

@AlexandreF-1qbit Thank you, that sounds pretty rad. It's actually surprising we haven't implemented something like that a long time ago, since it's so fundamental and impactful for computational cost / convergence. My guess is that we were not using UCCSD much and were mostly working with small systems, which was not that time-consuming.

If we manage to reused cached circuits and the results of the qubit mappings, overall we may end up with a VQE-UCC bundle that can be an order of magnitude faster and more flexible.

@JamesB-1qbit I may need just a little help understanding the choice of mapping (2, 0) -> (2^0 - 0^2) + (3 ^1 - 1^ 3) sometime in the future

alexfleury-sb commented 6 months ago

I think it is something that was falling into "nice to have" but was not in line with our research roadmap. It is nice to have shorter UCC circuits, but they still scale badly with the system size (and those ideas can be applied to other ansatze as well).

I can try to answer the second one: FermionOperator in OpenFermion have indices that are alternating between alpha (even numbers) and beta (odd numbers) spin orbitals. The fermionic term i^ j - j^ i would be linked to (i+1)^ (j+1) - (j+1)^ (i+1).