Skip to content

Tangelo v0.4.1 is here !

Compare
Choose a tag to compare
@ValentinS4t1qbit ValentinS4t1qbit released this 18 Oct 17:36
· 121 commits to main since this release
bfd03a2

Greetings, Tangelians.

Tangelo v0.4.1 is here ! It has been a little bit since the latest release: we’ll be attempting to make more frequent releases and updates to our main branch in order to make sure everyone is able to leverage the latest developments. We have a few cool things coming up, which will be rolled into version 0.4.2, scheduled for late November 2023.

Please cite this project if you happen to use it in your research: it means a lot to us and helps the community see what has been achieved with these tools. The BibTeX citation snippet is available at the bottom of the README, and any mention of Tangelo during your talks is deeply appreciated.

Credits

This release was possible thanks to the contributions of @AlexandreF-1qbit @JamesB-1qbit @ccoulombe and @ValentinS4t1qbit.

Highlights of this release:

Tutorials & Hands-on

It has never been easier to get started with Tangelo ! Every single attendee at our IEEE Quantum tutorial went to the Tangelo-Examples repository and got started within a minute without any install on their laptop (or even their tablet !) using colab_button.

The Tangelo team put together simple hands-ons that both let users get started with Tangelo and get a good overview of what it can do in a short amount of time. We strongly recommend them for both newcomers and experienced users ! They are rather simple exercises, and refer you to additional resources (Tangelo notebook tutorials, blog posts, publications, …) to learn what you need, and more if you choose to!

Your feedback pushed us to implement a tagging system for tutorial notebooks, which lets users find at a glance what tutorials are relevant to their interests ! Trying to find a feature or learn about a specific topic ? Here's a glimpse of what you will see:

tutorials

QM/MM problem decomposition method

Quantum Mechanics / Molecular Mechanics, also known as QM/MM, is a computational technique that enables the treatment of a region of a molecular system at a given level of quantum chemistry, while the remainder is modeled with force fields. One of the main applications of this framework is to consider solvent molecules explicitly, with a negligible computational overhead.

This comes handy in situations where the environmental effect is important, such as in the simulation of biochemical systems with solvent molecules or chemical reactions in amorphous materials. Our implementation currently supports electrostatic embedding and can be paired with both our quantum and classical solvers, using an interface similar to our ONIOM solver. A QM/MM tutorial will be released in November.

qmmm

from tangelo.problem_decomposition.qmmm.qmmm_problem_decomposition import QMMMProblemDecomposition
from tangelo.problem_decomposition.oniom._helpers.helper_classes import Fragment
from tangelo.toolboxes.molecular_computation.molecule import get_default_integral_solver

# The fragment object includes the 33 atoms from the Ala-Ala-Ala polypeptide, here defined in a PDB file.
frag = Fragment(solver_high="hf", selected_atoms=list(range(33), options_high={"basis": "sto-3g"})
qmmm = QMMMProblemDecomposition({"geometry": "AAA_solvated.pdb", "qmfragment": frag, "mmpackage": "openmm",
                                 "integral_solver": get_default_integral_solver(qmmm=True)})
energy = qmmm.simulate()

Note: some features may require you to install packages such as rdkit or openbabel-wheel through pip or conda.

QPESolver (Quantum Phase Estimation framework)

This summer, a user mentioned to us that they felt there was an overall lack of user-friendly QPE code in the community. Tangelo now provides a QPE framework which allows users to perform Quantum Phase Estimation on the desired molecule (or qubit operator) with a number of built-in options related to the time-evolution algorithm used in the controlled unitaries.

qpesolver

The interface of QPESolver is very similar to VQESolver, and should come very naturally to experienced users:

from tangelo.algorithms.projective.qpe import QPESolver

qpe_solver = QPESolver({"qubit_hamiltonian": qu_op, "size_qpe_register": 3, 
                        "ref_state": hf_circuit, "backend_options": {"target": "cirq"},
                	"unitary_options": {"time": -2*np.pi, "n_trotter_steps": 12, "n_steps_method": "time", "trotter_order": 4}})
qpe_solver.build()
energy = qpe_solver.simulate()

Users can even implement a custom Unitary object to define their own controlled time-evolution protocol and pass it to QPESolver as a black box ! Feel free to draw from our circuit toolbox to leverage other readily-available approaches such as multiproduct, quantum signal processing or truncated taylor series.

Check out our hands-on on fault-tolerant building blocks to see how to use QPE and some of the fault-tolerant building blocks in Tangelo (block encodings, amplitude amplification, time-evolution…).

This is only the beginning: this framework will be soon extended to support Iterative QPE, and can go even further with your contributions.

Circuit simplification

Simplify your quantum circuits by removing redundant gates, combining parametrized gates and removing those that are close to Identity. Combined with the function trim_trivial_qubits, you may be able to easily trim off qubits from both your circuits and qubit operators.

Did you know that quite a few parameters in VQE-UCC approaches are optimized to a value that is indistinguishable from zero for current quantum devices ? Therefore, many gates can be removed with little impact on the theoretical result. The example below shows how a pre-optimized VQE-UCCSD 12-qubit circuit for the $H_2O$ molecule can be simplified, taking down the number of gates from roughly 19K to 9K in under 3s on a laptop. The impact on the expectation value was only about $5 \times 10^{-5}$ Hartrees, well below chemical accuracy.

c = H2O_UCCSD_circuit   #gates = 19104 #qubits = 12
c.simplify()            #gates =  9324 #qubits = 12

Pytket users can use the translate_circuit function to convert their Tangelo circuit to the openQASM format, which can then be read in by pytket. See the example here.

With your help, Tangelo could support broader gate sets and more gate identities. This will help with compiling efficient circuits for various architectures.

Misc

  • Automated testing currently covering python 3.8, 3.9, 3.10, 3.11 (#333)
  • Installation: pyscf removed from requirements
  • Performance improvement: combinatorial mapping
  • Feature: ILC iteration now implements exact expansion / parameters
  • Feature: VQE-like algorithms verbose mode now prints and tracks energies, for users interested in the convergence of the algorithm.
  • Feature: Updates in IBMConnection to keep up with changes in qiskit-runtime, support for batch submission of circuits for sampler primitive.
  • Feature: function returning qubits used for truncated taylor series (#339)
  • Bugfix: Combinatorial mapping now handles spin != 0 (#330)
  • Bugfix: get_expectation_value takes into account n_shots for all backends supporting the option.
  • Bugfix: Fix corner case of FCI and CCSD solvers calculations (mo coefficients were occasionally recomputed differently).