Overview of examples
In addition to the detailed tutorials, InQuanto contains several example scripts showing how various functionality is used. In this file we provide a broad overview of the intention of each example, highlighting the functionality that is demonstrated. Examples using the extensions are found elsewhere.
algorithms/adapt
Examples of ADAPT-VQE.
File |
Description |
---|---|
A simulation of H2 in STO-3G using the ADAPT algorithm with fermionic helper functions. |
|
A simulation of H2 in STO-3G using the ADAPT algorithm. |
|
A simulation of H2 in STO-3G using IQEB algorithm. |
algorithms/qse
Examples of Quantum Subspace Expansion.
File |
Description |
---|---|
A simulation of H2 in STO-3G using the QSE algorithm |
algorithms/time_evolution
Examples of time evolution algorithms.
File |
Description |
---|---|
A AlgorithmMcLachlanRealTime time evolution simulation for a small system. |
|
A AlgorithmMcLachlanImagTime time evolution simulation |
|
An exact imaginary time evolution simulation using express methods |
|
A AlgorithmMcLachlanRealTime time evolution simulation |
|
A custom equation of motion VQS time evolution simulation. |
|
An exact time evolution simulation using express methods |
algorithms/vqd
Examples of Variational Quantum Deflation.
File |
Description |
---|---|
Variational Quantum Deflation using computables. |
algorithms/vqe
Examples of canonical Variational Quantum Eigensolver usage.
File |
Description |
---|---|
Use of minimizers in shot-based calculations. |
|
A canonical VQE simulation of H2 in STO-3G using a variational configuration interaction Ansatz. |
|
A canonical VQE simulation of H2 in STO-3G using a UCCSD Ansatz. |
|
A canonical VQE simulation of H2 in STO-3G using a hardware-efficient Ansatz. |
ansatzes
Examples demonstrating usage of Ansatz classes.
File |
Description |
---|---|
Use of a general Fermionic Ansatz. |
|
Preparation of a 6 qubit linear combination of fermionic occupation states with fixed coefficients. |
|
Use of a layered hardware efficient Ansatz. |
|
Preparation of a 6 qubit linear combination of fermionic occupation states with fixed coefficients. |
|
Preparation of a 4 qubit linear combination of fermionic occupation states with fixed coefficients. |
|
Use of a linear combination of fermionic occupation states as a variational ansatz. |
|
Preparation of a 4 qubit linear combination of fermionic occupation states with fixed coefficients. |
computables
Examples demonstrating usage of computables classes.
File |
Description |
---|---|
Demonstrates the general use of computables and protocols. |
computables/atomic
Examples demonstrating usage of atomic computable classes.
File |
Description |
---|---|
Protocol observable averaging to calculate expectation values. |
|
Use of computables classes for STO-3G H2 expectation value and gradients with symbolic protocol. |
|
An example showing how to use evaluate gradients and compare against finite differences |
|
Computable expression example (OverlapSquared) |
|
An example using protocol list for finite differences |
|
Computable expression example (ExpectationValue) |
|
Use of symbolic protocol for expectation value. |
|
Use of computables classes for STO-3G H2 expectation value measurement. |
|
An example showing how to use evaluate gradients |
computables/composite
Examples demonstrating usage of composite computable classes.
File |
Description |
---|---|
Basic CI calculation with NonOrthogonal computable. |
|
Simple overlap matrix calculation. |
|
An example running QSE using computables |
computables/composite/gf
Examples demonstrating usage of Green’s function computable classes.
File |
Description |
---|---|
Example of evaluating KrylovSubspaceComputable with sandwiched moments from shot-based protocol. |
|
Generation of the circuits required for the full GF matrix of the Hubbard dimer. |
|
Use of KrylovSubspaceComputable to get Green’s function element from shot-based protocol from 1st Lanczos vector. |
|
Example of evaluating LanczosCoefficientsComputable to get elements of tridiagonal matrix. |
|
Computation (shots for Lanczos, statevector for ground state) one element of GF of Hubbard dimer. |
|
Example of evaluating LanczosMatrixComputable to get tridiagonal matrix for given dimension of Krylov space. |
|
Computation of the full GF matrix of the Hubbard dimer with shots, and plot the spectral function A(omega). |
|
Computation of the full GF matrix of the Hubbard dimer, and plot the spectral function A(omega). |
|
Computation (noiseless statevector) the full GF matrix of the Hubbard dimer at a single frequency. |
|
Example of evaluating LanczosMatrixComputable with sandwiched moments from shot-based protocol. |
|
Computation (shots for Lanczos, shots for ground state) one element of GF of Hubbard dimer. |
|
Example of building your own Lanczos routine, then comparing it to KrylovSubspaceComputable. |
|
Noiseless statevector computation of one element of GF of Hubbard dimer by sandwiching Hamiltonian moments. |
computables/composite/rdm
Examples demonstrating usage of reduced density matrix computable classes.
File |
Description |
---|---|
Test of NEVPT2 using RDMs from |
|
An example for constructing an RDM using computables |
computables/primitive
Examples demonstrating usage of primitive computable classes.
File |
Description |
---|---|
An example showing how to use quantum computables. |
core
Examples demonstrating usage of logging and debugging functionality.
File |
Description |
---|---|
Simple demonstrations of manipulating Symbols and SymbolDict in inquanto |
|
Using context for logging standard outputs |
embeddings
Examples of usage of embedding methods.
File |
Description |
---|---|
Full DMET calculations on hydrogen rings. |
|
An example impurity DMET simulation of a 3-dihydrogen ring using the express module. |
|
One-shot DMET calculations on hydrogen rings |
|
One-shot DMET calculations on hydrogen rings. |
express
Examples of usage of the built-in example molecular data in InQuanto.
File |
Description |
---|---|
Built-in example molecular data. |
|
Basic code snippets to use express, operators and states. |
mappings
Examples of fermion-qubit mapping functionality.
File |
Description |
---|---|
Use and comparison of the paraparticle mapping from fermions to qubits |
|
Use of the Bravyi-Kitaev mapping from fermions to qubits. |
|
Use of the Jordan-Wigner mapping from fermions to qubits. |
minimizers
Examples of classical minimizers in InQuanto.
File |
Description |
---|---|
Use of minimizers. |
|
Symbolic evaluation and comparing integrator methods. |
operators
Examples of functionality of operator and state classes.
File |
Description |
---|---|
Orbital transformation methods. |
|
Construction of QubitState and demonstration of some functionality. |
|
Creation of FermionState objects and demonstration of some functionality. |
|
Examples of some FermionOperator methods. |
|
Creation of ChemistryRestrictedIntegralOperator (CRIO) and conversion to FermionOperator. |
|
Simple energy calculation using a double factorized hamiltonian. |
|
Orbital optimization using Pipek-Mezey as an example. |
|
Construction of QubitOperator and demonstration of some functionality. |
protocols
Examples demonstrating usage of protocol classes.
File |
Description |
---|---|
Use of phase shift derivative for STO-3G H2 expectation value measurement. |
|
Running PauliAveraging with inquanto’s noise mitigation. |
|
Usage of the PauliAveraging and HadamardTest protocols. |
|
Use of phase shift derivative for STO-3G H2 expectation value measurement. |
|
Example using PMSV error mitigation to calculate expectation values. |
|
Protocol observable averaging to calculate expectation values. |
|
Example using a simple ProjectiveMeasurements protocol. |
|
Protocol observable averaging to calculate expectation values. |
|
Calculating complex overlaps with the HadamardTestOverlap protocol. |
|
Partition measurement reduction strategies for PauliAveraging protocol. |
|
Running protocols via Qermit’s MitRes and MitEx and inquanto’s noise mitigation. |
|
Compare different shot based protocols for calculating an overlap squared. |
|
Use of phase shift derivative for STO-3G H2 expectation value measurement. |
|
Running protocols via Qermit’s MitRes and MitEx. |
protocols/phase_estimation
Examples demonstrating usage of the quantum phase estimation protocols.
File |
Description |
---|---|
Demonstration of the generation of IPEA unitaries for statevector simulation. |
|
Demonstration of the generation of IPEA circuits, and their use for Hadamard test sampling. |
|
Demonstration of the generation of IPEA circuits with the specialized Quantinuum protocols. |
spaces
Examples of space classes for generating operators and states.
File |
Description |
---|---|
Use of FermionSpace objects to generate fermionic states and operators, including point group symmetry. |
|
Use of ParaFermionSpace objects to generate parafermionic states and operators. |
|
Use of QubitSpace object to generate qubit operators. |
symmetry
Examples of symmetry classes and functionality.
File |
Description |
---|---|
Use of PointGroup class containing point group symmetry information. |
|
Finding qubit Z2 symmetry operators. |
|
Finding fermionic Z2 symmetry operators. |
|
Qubit tapering - operators and Ansatzae. |