question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the expected enhancement?

UCCSD needs to be refactored for several reasons:

  • it is incompatible with the VQE implementation provided by Qiskit Terra
  • it uses the (soon-to-be-removed) FermionicOperator class
  • it uses the legacy WeightedPauliOperator

The following requirements should be met by the new implementation:

  • it should derive BlueprintCircuit and, thus, be compatible with Terra
  • the hopping operator factory logic should be moved to an external place as it can also be of use elsewhere (currently FermionicTransformation actually uses the logic inside of UCCSD)
  • it should make use of the new FermionicOp and opflow operators
  • ideally, the hopping operator factory should be generalized to work for any kind of exctitation (S, D, T, Q, …)
  • ideally, we would have a UCC class in which the user can freely specify the types of excitations he would like to have
  • (we may provide ease-of-use subclasses like UCCSD, UCCD, etc.)

Once UCCSD has been refactored we should also be able to replace all qiskit.aqua imports with their new counterparts. Thus, the critical status of this issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
woodsp-ibmcommented, Mar 3, 2021

This refactor should also include the UVCC var form too right that was done for Bosonic Problems. I think the same EvolvedOp base class should be usable for this, but it needs bosonic hopping operators; so maybe we need to be careful about naming of the excitation and hopping logic above to differentiate things.

1reaction
Cryoriscommented, Feb 22, 2021

Summarizing use cases from the discussion we had (modulo correct class and argument names):

# case 1
gse = GroundStateEigensolver(UCCSDVQEFactory(), mapper)
gse.solve(molecular_problem)

# case 2
h2 = (I ^ I) + (Z ^ Z) + ...  # copy my hamiltonian from somewhere or construct it manually

uccsd = UCCSD(4, 2, mapper, symmetry_info)  # put in proper mapper and symmetry info
vqe = VQE(uccsd, optimizer)
vqe.compute_min_eigenvalue(h2)


# case 3
class MyFactory():
    # uccsd = UCCSD()
    # vqe = VQE(uccsd, optimizer)

gse = GroundStateEigensolver(MyFactory(), mapper)
gse.solve(molecular_problem)

and the proposed circuit structure:


class EvolvedOperatorAnsatz(BlueprintCircuit):
    """
    Examples:
        excitations = build_excitation_ops(num_part, num_orb)
        mapper = Mapper()
        mapped_excitations = mapper.map(excitations)
        # and other postproc

        ucc = EvolvedOperatorAnsatz(mapped_excitations)
    """
    def __init__(self, ops=None, evolution=None):
        pass

class UCC(EvolvedOperatorAnsatz):
    """
    Examples:
        ucc = UCC('sdt', num_part, num_orb, mapper)

        excitations = build_excitation_ops(num_part, num_orb, 'sdt')
        ucc = UCC(excitations, mapper)
    """
    def __init__(self, excitations=None, num_part=None, num_orb=None, mapper=None):
        pass

class UCCSD(UCC):
    def __init__(self, num_part=None, num_orb=None, mapper=None):
        super().__init__('sd', num_part, num_orb, mapper)
Read more comments on GitHub >

github_iconTop Results From Across the Web

[refactor] Towards a non-driver focused future #701 - GitHub
What should we add? This Epic outlines the plan for the upcoming restructuring of the entire Qiskit Nature code base.
Read more >
Is the Trotterized UCCSD Ansatz Chemically Well-Defined?
To answer this question, we perform classical simulations with randomly shuffled operators using a custom code built with OpenFermion30 and Psi4 ...
Read more >
Excited states solvers — Qiskit 0.25.4 documentation
In this tutorial we are going to discuss the excited states calculation interface of Qiskit Chemistry. The goal is to compute the excited...
Read more >
implement variational quantum eigensolver with openfermion
Can someone provide me with an example about how to implement VQE with OpenFermion, for example, use the UCCSD ansatz to get the...
Read more >
Coupled Cluster Calculations - NWChem
Because of the extensive refactoring of the code to maximize OpenMP performance and the intrinsic non-associativity of floating-point arithmetic, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found