Algorithms
InQuanto aims to facilitate the use and development of quantum algorithms for the simulation of quantum chemistry. Over recent years, this field has grown dramatically, and research efforts in this regard are expected to intensify as the capabilities of quantum hardware grow. These efforts are reliant on both studies in method development and in the application of known techniques to characterise their behavior in meaningful contexts. While the lower-level functionality available in InQuanto is appropriate for the former of these, the latter may require a higher-level approach. The inquanto.algorithms
module provides such high-level capabilities for running various predefined algorithms.
There are a variety of algorithm classes built into InQuanto - most of which are discussed in the following pages, with a full list provided in the API reference. Although the settings and input data differs between algorithms, they share a common structure in their usage. This structure is demonstrated in Fig. 3.
Fig. 3 An example of the usage of a high-level algorithm class in InQuanto. System and algorithmic details are provided to the Algorithm
instance at construction, normally using computable , then compilation and simulation details are provided when calling the .build()
method. The .run()
method is used to perform the computation.
Firstly, the instance of the algorithm class must be created, with specification of problem and system details. These details correspond to the higher-level, abstract properties of the algorithm to be performed. For example, they may describe which expectation value is to be calculated, or which classical minimizer to use for a variational optimization. Note that this set of parameters does not include details with regards to circuit compilation or simulation - these details are input at the .build()
stage. Although there is much overlap between algorithms, the precise types of input required here depends on the algorithm to be simulated; a discussion of the requirements for each algorithm is provided in the following pages.
After the Algorithm
instance is created, it must be built. Building an algorithm in InQuanto refers to the building of the quantum circuits and surrounding computational processes necessary to run the algorithm. Again, the necessary parameters provided to the build()
method are dependent on the algorithm in question, and specific details are provided below for each algorithm class. The build
process also will require the specification of one or more Protocols. These objects instruct InQuanto in how to compile the quantum circuits themselves, and require defining a pytket backend. Pytket backends are used to access different simulation strategies - whether using classical simulation, an emulator of quantum hardware, or a quantum device. The availability of various protocols will depend on the computational backend used, and on the algorithm which is to be performed.
Having constructed and built the Algorithm
object, the algorithm can be executed using the run
method. Typically, no further input is required at this stage. It is separated from the previous steps due to the fact that the heaviest computational burden (in the case of classical simulation of a quantum device, exponentially so) occurs in this step. This step performs the algorithm using the specified computational backend. Once this step is complete, results may be obtained from the Algorithm
object, for example using the generate_report()
method. Note that generate_report()
is designed for inspection and should not be used for data processing.
In the remainder of this chapter, we cover each algorithm class provided by InQuanto in detail.