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 custom equation of motion VQS time evolution simulation. |
|
An exact time evolution simulation using express methods |
|
A AlgorithmMcLachlanRealTime time evolution simulation for a small system. |
|
A AlgorithmMcLachlanImagTime time evolution simulation |
|
A AlgorithmMcLachlanRealTime time evolution simulation |
|
An exact imaginary 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 UCCSD Ansatz. |
|
A canonical VQE simulation of H2 in STO-3G using a hardware-efficient Ansatz. |
|
A canonical VQE simulation of H2 in STO-3G using a variational configuration interaction Ansatz. |
ansatzes¶
Examples demonstrating usage of Ansatz classes.
File |
Description |
---|---|
Preparation of a 6 qubit linear combination of fermionic occupation states with fixed coefficients. |
|
Preparation of a 6 qubit linear combination of fermionic occupation states with fixed coefficients. |
|
Use of a linear combination of fermionic occupation states as a variational ansatz. |
|
Use of a layered hardware efficient Ansatz. |
|
Preparation of a 4 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 general Fermionic Ansatz. |
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 |
---|---|
Use of computables classes for STO-3G H2 expectation value measurement. |
|
An example using protocol list for finite differences |
|
Computable expression example (OverlapSquared) |
|
Use of symbolic protocol for expectation value. |
|
An example showing how to use evaluate gradients |
|
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 (ExpectationValue) |
|
Protocol observable averaging to calculate expectation values. |
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 |
|
Estimating energy using QCM4 computable. |
computables/composite/gf¶
Examples demonstrating usage of Green’s function computable classes.
File |
Description |
---|---|
Example of evaluating LanczosMatrixComputable with sandwiched moments from shot-based protocol. |
|
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 building your own Lanczos routine, then comparing it to KrylovSubspaceComputable. |
|
Computation (shots for Lanczos, shots for ground state) one element of GF of Hubbard dimer. |
|
Computation of the full GF matrix of the Hubbard dimer, and plot the spectral function A(omega). |
|
Example of evaluating LanczosMatrixComputable to get tridiagonal matrix for given dimension of Krylov space. |
|
Computation (noiseless statevector) the full GF matrix of the Hubbard dimer at a single frequency. |
|
Use of KrylovSubspaceComputable to get Green’s function element from shot-based protocol from 1st Lanczos vector. |
|
Example of evaluating KrylovSubspaceComputable with sandwiched moments from shot-based protocol. |
|
Computation of the full GF matrix of the Hubbard dimer with shots, and plot the spectral function A(omega). |
|
Noiseless statevector computation of one element of GF of Hubbard dimer by sandwiching Hamiltonian moments. |
|
Generation of the circuits required for the full GF matrix of the Hubbard dimer. |
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 |
---|---|
Using context for logging standard outputs |
embeddings¶
Examples of usage of embedding methods.
File |
Description |
---|---|
An example impurity DMET simulation of a 3-dihydrogen ring using the express module. |
|
Full DMET calculations on hydrogen rings. |
|
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 |
---|---|
Basic code snippets to use express, operators and states. |
|
Built-in example molecular data. |
mappings¶
Examples of fermion-qubit mapping functionality.
File |
Description |
---|---|
Use of the Bravyi-Kitaev mapping from fermions to qubits. |
|
Use of the Jordan-Wigner mapping from fermions to qubits. |
|
Use and comparison of the paraparticle mapping from fermions to qubits |
minimizers¶
Examples of classical minimizers in InQuanto.
File |
Description |
---|---|
Symbolic evaluation and comparing integrator methods. |
|
Use of minimizers. |
operators¶
Examples of functionality of operator and state classes.
File |
Description |
---|---|
Simple shot-based energy calculation using a double factorized, unrestricted-spin hamiltonian. |
|
Examples of some FermionOperator methods. |
|
Construction of QubitState and demonstration of some functionality. |
|
Orbital optimization using Pipek-Mezey as an example. |
|
Creation of FermionState objects and demonstration of some functionality. |
|
Orbital transformation methods. |
|
Statevector calculations of energy with a double factorized hamiltonian. |
|
Simple shot-based energy calculation using a double factorized hamiltonian. |
|
Creation of ChemistryRestrictedIntegralOperator (CRIO) and conversion to FermionOperator. |
|
Construction of QubitOperator and demonstration of some functionality. |
protocols¶
Examples demonstrating usage of protocol classes.
File |
Description |
---|---|
Running protocols via Qermit’s MitRes and MitEx and inquanto’s noise mitigation. |
|
Use of Hadamard test derivative for STO-3G H2 expectation value measurement with a hardware-efficient ansatz. |
|
Example using PMSV error mitigation to calculate expectation values. |
|
Running PauliAveraging with inquanto’s noise mitigation. |
|
Use of Hadamard test derivative for STO-3G H2 expectation value measurement in direct and indirect mode. |
|
Calculating complex overlaps with the FactorizedOverlap protocols and comparing to HadamardTestOverlap. |
|
Usage of the PauliAveraging and HadamardTest protocols. |
|
Compare different shot based protocols for calculating an overlap squared. |
|
Partition measurement reduction strategies for PauliAveraging protocol. |
|
Use of Hadamard test derivative for STO-3G H2 expectation value measurement. |
|
Calculating complex overlaps with the HadamardTestOverlap protocol. |
|
Protocol observable averaging to calculate expectation values. |
|
Protocol observable averaging to calculate expectation values. |
|
Running protocols via Qermit’s MitRes and MitEx. |
|
Example using a simple ProjectiveMeasurements protocol. |
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 with the specialized Quantinuum protocols. |
|
Demonstration of the generation of IPEA circuits, and their use for Hadamard test sampling. |
spaces¶
Examples of space classes for generating operators and states.
File |
Description |
---|---|
Use of QubitSpace object to generate qubit operators. |
|
Use of ParaFermionSpace objects to generate parafermionic states and operators. |
|
Use of FermionSpace objects to generate fermionic states and operators, including point group symmetry. |
symmetry¶
Examples of symmetry classes and functionality.
File |
Description |
---|---|
Finding fermionic Z2 symmetry operators. |
|
Finding qubit Z2 symmetry operators. |
|
Use of PointGroup class containing point group symmetry information. |
|
Qubit tapering - operators and Ansatzae. |