Embodiments of the present disclosure relate to the field of quantum circuit simulation.
Recently, several quantum computers have been developed by various companies. However, quantum computers are still not commercially available. In order to enable development of quantum algorithms, as well as verification and validation of the upcoming quantum processors, quantum computer simulators may provide an efficient platform.
However, in practice, simulation of quantum computers and in general quantum circuits is a highly complex task, which requires in particular a large amount of memory. The complexity grows with the number of qubits processed in the simulation.
There have been different approaches regarding the quantum circuit simulation. Some of them are listed below and further referred to in the description:
The above mentioned approaches may still suffer from complexity and low flexibility regarding the selection of the results to be simulated.
The present disclosure is defined by the independent claims. Some of the advantageous embodiments are subject matter to the dependent claims.
According to a first aspect, the disclosure relates to an apparatus for decoding for simulating a quantum circuit. The apparatus includes a processing circuitry. The processing circuitry is configured to receive an indication of a subset of input and output qubits of the quantum circuit, the indicated subset corresponding to an amplitude tensor of the quantum circuit that is to be determined, the amplitude tensor comprising amplitudes for different combinations of states of the qubits of the indicated subset; determine, using a tensor network of the quantum circuit and Restricted Maximum Cardinality Search, RMCS, an elimination order of intermediate qubits within the quantum circuit; and determine the amplitude tensor by removing, successively in accordance with the elimination order, that indices of the tensors of the tensor network that correspond to the intermediate qubits from the tensor network.
Using RMCS it is possible to determine an optimal/optimized elimination sequence for an arbitrary subset of amplitudes. This may reduce the computational cost and memory requirements to simulate quantum circuits.
In a possible first implementation form of the apparatus according to the first aspect or the first aspect as such, the elimination order is determined iteratively, in reverse order, by selecting from the intermediate qubits, in each step of the iteration, an intermediate qubit that i) has not been selected in any preceding step of the iteration, and ii) corresponds, in a chordal graph representing the tensor network, to a vertex neighboring a maximum number of vertices that correspond to either a) an intermediate qubit that has been selected in any preceding step of the iteration, or b) a qubit in the indicated subset.
In a possible implementation form of the apparatus according to the first implementation form of the first aspect or the first aspect as such, each intermediate qubit uniquely corresponds to a respective index of the tensors, each qubit in the indicated subset uniquely corresponds to a respective index of the tensors, and each index of the tensors uniquely corresponds to either an input qubit, an output qubit, or an intermediate qubit; and/or there is a one to one correspondence between the vertices of the chordal graph and that indices that correspond to either an intermediate qubit or a qubit in the indicated subset.
In a possible implementation form of the apparatus according to the second implementation form of the first aspect or the first aspect as such, the chordal graph representing the tensor network is a chordal completion of a non-chordal graph representing the tensor network that has a minimized maximal clique among chordal completions of said non-chordal graph.
In a possible implementation form of the apparatus according to the preceding implementation or the first aspect as such, the chordal graph is obtained from the non-chordal graph representing the tensor network using an optimized elimination order of the vertices of the non-chordal graph, wherein the chordal graph is obtained by adding edges to said non-chordal graph such that, for each vertex, all neighbors of the vertex that are later in the optimized elimination order than said vertex are a clique in the chordal graph.
In a possible implementation form of the apparatus according to the preceding implementation or the first aspect as such, for each quantum gate of the quantum circuit, there is a tensor of the tensor network that has, for each qubit of the quantum gate that is either an intermediate qubit or in the indicated subset, one index that corresponds to said qubit; for each quantum gate of the quantum circuit, that vertices of the non-chordal graph that correspond to the qubits of said quantum gate are a clique.
In a possible implementation form of the apparatus according to the preceding implementation or the first aspect as such, the determining of the elimination order of the intermediate qubits includes determining the optimized elimination order.
In a possible implementation form of the apparatus according to the preceding implementation or the first aspect as such, the optimized elimination order of the vertices of the non-chordal graph representing the tensor network is determined using an optimization procedure. The optimization procedure minimizes a maximal clique of that graph that is obtained by adding edges to the non-chordal graph such that, for each vertex of the graph, all neighbors of said vertex that are later in the optimized elimination order than said vertex are a clique in the graph.
In a possible implementation form of the apparatus according to the two preceding implementations or the first aspect as such, before the determining of the optimized elimination order, the non-chordal graph is modified by adding, to the non-chordal graph, edges such that the vertices corresponding to the qubits of the indicated subset are a clique.
In a possible implementation form of the apparatus according to the first implementation form of the first aspect or the first aspect as such, the processing circuitry is configured to determine, in accordance with the indicated subset, the non-chordal graph representing the tensor network such that i) there is a one to one correspondence between the vertices of the non-chordal graph and that indices of the tensors that correspond to either an intermediate qubit or a qubit in the indicated subset; and ii) for each tensor of the tensor network, the vertices of the non-chordal graph that correspond to said tensor are a clique.
In a possible implementation form of the apparatus according to the first implementation form of the first aspect or the first aspect as such, the processing circuitry is configured to determine, in accordance with the indicated subset, the non-chordal graph representing the tensor network from a generic non-chordal graph representing the tensor network by adding i) for each input or output qubit that is in the indicated subset, a single vertex that corresponds to said qubit, and ii) edges such that, for each quantum gate of the quantum circuit, that vertices of the non-chordal graph that correspond to the qubits of said quantum gate are a clique, wherein there is a one to one correspondence between the vertices of the generic non-chordal graph and the intermediate qubits.
In a possible implementation form of the apparatus according to the first implementation form of the first aspect or the first aspect as such, the processing circuitry is configured to determine, in accordance with the indicated subset, the non-chordal graph representing the tensor network from a universal non-chordal graph representing the tensor network by removing, for each input or output qubit that is not in the indicated subset all edges connecting a vertex that corresponds to the qubit, and all vertices that correspond to the qubit; wherein there is a one to one correspondence between the vertices of the universal non-chordal graph and qubits of the quantum circuit, wherein each qubit of the quantum circuit is either an input qubit, an output qubit, or an intermediate qubit.
In a possible implementation form of the apparatus according to any preceding implementation of the first aspect or the first aspect as such, the processing circuitry is configured to remove, before removing the indices corresponding to the intermediate qubits, that indices from the tensors of the tensor network that correspond to either i) an input qubit that is not in the indicated subset, or ii) an output qubit that is not in the indicated subset.
In a possible implementation form of the apparatus according to any preceding implementation of the first aspect or the first aspect as such, the indices corresponding to either an input qubit that is not in the indicated subset or an output qubit that is not in the indicated subset are removed from the tensor network by setting the indices to respective predetermined values; and/or the indices corresponding to the intermediate qubits are removed from the tensor network by contraction.
According to a second aspect, the disclosure relates to a method for simulating a quantum circuit. The method includes the steps of receiving an indication of a subset of input and output qubits of the quantum circuit, the indicated subset corresponding to an amplitude tensor of the quantum circuit that is to be determined, the amplitude tensor comprising amplitudes for different combinations of states of the qubits of the indicated subset; determining, using a tensor network of the quantum circuit and Restricted Maximum Cardinality Search, RMCS, an elimination order of intermediate qubits within the quantum circuit; and determining the amplitude tensor by removing, successively in accordance with the elimination order, that indices of the tensors of the tensor network that correspond to the intermediate qubits from the tensor network.
In a possible first implementation form of the method according to the second aspect as such, the elimination order is determined iteratively, in reverse order, by selecting from the intermediate qubits, in each step of the iteration, an intermediate qubit that i) has not been selected in any preceding step of the iteration, and ii) corresponds, in a chordal graph representing the tensor network, to a vertex neighboring a maximum number of vertices that correspond to either a) an intermediate qubit that has been selected in any preceding step of the iteration, or b) a qubit in the indicated subset.
In a possible implementation form of the method according to the first implementation form of the second aspect or the second aspect as such, each intermediate qubit uniquely corresponds to a respective index of the tensors, each qubit in the indicated subset uniquely corresponds to a respective index of the tensors, and each index of the tensors uniquely corresponds to either an input qubit, an output qubit, or an intermediate qubit; and/or there is a one to one correspondence between the vertices of the chordal graph and that indices that correspond to either an intermediate qubit or a qubit in the indicated subset.
In a possible implementation form of the method according to the second implementation form of the second aspect or the second aspect as such, the chordal graph representing the tensor network is a chordal completion of a non-chordal graph representing the tensor network that has a minimized maximal clique among chordal completions of said non-chordal graph.
In a possible implementation form of the method according to the preceding implementation or the second aspect as such, the chordal graph is obtained from the non-chordal graph representing the tensor network using an optimized elimination order of the vertices of the non-chordal graph, wherein the chordal graph is obtained by adding edges to said non-chordal graph such that, for each vertex, all neighbors of the vertex that are later in the optimized elimination order than said vertex are a clique in the chordal graph.
In a possible implementation form of the method according to the preceding implementation or the second aspect as such, for each quantum gate of the quantum circuit, there is a tensor of the tensor network that has, for each qubit of the quantum gate that is either an intermediate qubit or in the indicated subset, one index that corresponds to said qubit; for each quantum gate of the quantum circuit, that vertices of the non-chordal graph that correspond to the qubits of said quantum gate are a clique.
In a possible implementation form of the method according to the preceding implementation or the second aspect as such, the determining of the elimination order of the intermediate qubits includes determining the optimized elimination order.
In a possible implementation form of the method according to the preceding implementation or the second aspect as such, the optimized elimination order of the vertices of the non-chordal graph representing the tensor network is determined using an optimization procedure. The optimization procedure minimizes a maximal clique of that graph that is obtained by adding edges to the non-chordal graph such that, for each vertex of the graph, all neighbors of said vertex that are later in the optimized elimination order than said vertex are a clique in the graph.
In a possible implementation form of the method according to the two preceding implementations or the second aspect as such, before the determining of the optimized elimination order, the non-chordal graph is modified by adding, to the non-chordal graph, edges such that the vertices corresponding to the qubits of the indicated subset are a clique.
In a possible implementation form of the method according to the first implementation form of the second aspect or the second aspect as such, the method includes a step of determining, in accordance with the indicated subset, the non-chordal graph representing the tensor network such that i) there is a one to one correspondence between the vertices of the non-chordal graph and that indices of the tensors that correspond to either an intermediate qubit or a qubit in the indicated subset; and ii) for each tensor of the tensor network, the vertices of the non-chordal graph that correspond to said tensor are a clique.
In a possible implementation form of the method according to the first implementation form of the second aspect or the second aspect as such, the method includes a step of determining, in accordance with the indicated subset, the non-chordal graph representing the tensor network from a generic non-chordal graph representing the tensor network by adding i) for each input or output qubit that is in the indicated subset, a single vertex that corresponds to said qubit, and ii) edges such that, for each quantum gate of the quantum circuit, that vertices of the non-chordal graph that correspond to the qubits of said quantum gate are a clique, wherein there is a one to one correspondence between the vertices of the generic non-chordal graph and the intermediate qubits.
In a possible implementation form of the method according to the first implementation form of the second aspect or the second aspect as such, the method includes a step of determining, in accordance with the indicated subset, the non-chordal graph representing the tensor network from a universal non-chordal graph representing the tensor network by removing, for each input or output qubit that is not in the indicated subset all edges connecting a vertex that corresponds to the qubit, and all vertices that correspond to the qubit; wherein there is a one to one correspondence between the vertices of the universal non-chordal graph and qubits of the quantum circuit, wherein each qubit of the quantum circuit is either an input qubit, an output qubit, or an intermediate qubit.
In a possible implementation form of the method according to any preceding implementation of the second aspect or the second aspect as such, the method includes a step of removing, before removing the indices corresponding to the intermediate qubits, that indices from the tensors of the tensor network that correspond to either i) an input qubit that is not in the indicated subset, or ii) an output qubit that is not in the indicated subset.
In a possible implementation form of the method according to any preceding implementation of the second aspect or the second aspect as such, the indices corresponding to either an input qubit that is not in the indicated subset or an output qubit that is not in the indicated subset are removed from the tensor network by setting the indices to respective predetermined values; and/or the indices corresponding to the intermediate qubits are removed from the tensor network by contraction.
The advantages of the methods according to the second aspect are the same as those for the corresponding implementation forms of the apparatuses according to the first aspect.
According to a third aspect, the disclosure relates to a computer program product including instructions stored on a non-transitory storage medium. The computer program product executes, when performed on one or more processors, a method according to the first or second aspect or any possible embodiment of the first or second aspect when executed.
Details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims.
In the following embodiments of the disclosure are described in more detail with reference to the attached figures and drawings, in which:
a)-f) is a graphical representation of producing, from a graph and the elimination order π=[ijklmn], a chordal graph;
a)-g) is a graphical representation of constructing, from a chordal graph H=(V, {tilde over (E)}) and a subset of vertices C⊂V, which are clique, a perfect elimination order it, which has the vertices of C at the end;
In the following, identical reference signs refer to identical or at least functionally equivalent features.
In the following description, reference is made to the accompanying figures, which form part of the disclosure, and which show, by way of illustration, specific aspects of embodiments of the disclosure or specific aspects in which embodiments of the present disclosure may be used. It is understood that embodiments of the disclosure may be used in other aspects and comprise structural or logical changes not depicted in the figures. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present disclosure is defined by the appended claims.
For instance, it is understood that a disclosure in connection with a described method may also hold true for a corresponding device or system configured to perform the method and vice versa. For example, if one or a plurality of specific method steps are described, a corresponding device may include one or a plurality of units (in other words, modules or circuits), e.g. functional units, to perform the described one or plurality of method steps (e.g. one unit performing the one or plurality of steps, or a plurality of units each performing one or more of the plurality of steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a specific apparatus is described based on one or a plurality of units, e.g. functional units, a corresponding method may include one step to perform the functionality of the one or plurality of units (e.g. one step performing the functionality of the one or plurality of units, or a plurality of steps each performing the functionality of one or more of the plurality of units), even if such one or plurality of steps are not explicitly described or illustrated in the figures. Further, it is understood that the features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless specifically noted otherwise.
The current disclosure is devoted to the efficient simulation of quantum circuits (digital quantum computers). The task of quantum circuit simulation is necessary for the development of quantum algorithms, as well as for the verification and validation of the upcoming quantum processors.
A quantum computer operates on the state of a collection (e.g. a plurality, a system, or a set) of two-state quantum systems, also called qubits. Unlike an ordinary bit, which can assume only two values, i.e., is either in state “0” or “1”; the state of a qubit is a vector in a two-dimensional complex vector space. It is convenient to express the general state of a qubit as a linear combination (or superposition) of two computational basis states, denoted as |0 and |1, which form an orthonormal basis of said vector space, i.e., satisfy the conditions 1|0=0|1=0, and 0|0=1|1=1. Noteworthy, these conditions leave some freedom of choice of the computational basis states. For instance, the two states |+=(|0+|1)/√{square root over (2)} and |−=(|0−|1)/√{square root over (2)} form also an orthonormal basis, and may alternatively be used to describe the states of qubits. Representing the computational states as vectors,
the state or an arbitrary qubit can then be written as
where α is the amplitude of the state |0, and β is the amplitude of the state |1. In other words, a qubit can be in a linear combination of the states |0and ∥1. If the state |ϕ satisfies the normalization condition ϕ|ϕ=|α|2+|β|2=1, the result of a measurement performed on the qubit (e.g., of a measurement of the spin of an electron) is either 0 with probability |α|2, or 1 with probability |β|2.
The state |ψ of a system of N qubits is specified by 2N amplitudes, or, in other words, is a vector in a 2N dimensional vector space. In analogy to the above, the computational basis states of the N qubit-system can be written in the form
e
i
, . . . i
=|i
1
⊗ . . . ⊗|i
N
=|i
1
, . . . ,i
N
,
where ⊗ stays for an outer product of vectors representing the individual qubits, and the indices ii can assume the values 0 and 1. Thus, the state of an arbitrary system of N qubits can then be written as
|ψ=Σi
As can be seen from the above, given a basis |i1, . . . , iN, |ψ corresponds to a type (N, 0) tensor ψi
For instance, let us assume we have a 4-qubit state |ψ and are interested in the probability of observing the qubit-string b=0001, i.e., of observing the first, second, third, and fourth qubit in the state |0, |0, |0, and |1, respectively. In other words, we are interested in the probability |ψ0001|2 of finding the 4-qubit system in the state
e
0001=|0⊗|0⊗|0⊗|1=|0001.
Then, the amplitude ψ0001, which corresponds to the state |0001 (or the qubit-string b) and is the entry of the tensor ψi
ψ0001=e0001|ψ,
which is the inner product between the vectors |e0001 and |0.
As far as quantum programs are concerned, the operation of a quantum circuit can be expressed as an action of the circuit's matrix C, which in general in unitary, on the initial state |ϕ of the quantum circuit:
|ψ=C|ϕ,
which is followed by a measurement on the final state |ψ of the quantum circuit.
In order to simulate a quantum computation, one usually evaluates/determines entries of the tensor ψi
In a first approach (full state approach), one obtains all amplitudes of |0 at once by applying sparse linear transformations to the amplitude vector |0 (full state simulation, [1]):
|ψ=C|ϕ=Cd·Cd-1· . . . ·C1|ϕ
Here, the whole circuit matrix C is expanded as a product of operations represented by (unitary) matrices Cj, each performed at a respective corresponding (clock) cycle jϵ[1, . . . , d] of the circuit. However, the straightforward application of gates to the full state vector, as in [1], is hard to optimize. Additionally, large quantities of RAM are required for such programs, which restricts the maximal size of circuits to around 50 qubits on modern hardware. Mostly older programs are based on the sequential application of sparse matrices Ck to the state vector (e.g., the initial state vector |0).
In a second approach (single amplitude approach), the individual amplitudes are calculated one by one by evaluating vector-matrix-vector products (e.g., evaluating matrix elements of C):
σk=ek|ψ=ek|Cd·Cd-1 . . . C1|ϕ
The sparse matrices Ci are outer products of single or two-qubit gates. To utilize the internal structure of Ci it is more convenient to represent them as type (N, N) tensors (with N contravariant and N covariant indices and thus rank 2N) acting on |ϕ. In analogy to the state vector |ψ, the circuit matrix can be written as
C=C
j
, . . . ,j
i
, . . . ,i
|i
1
, . . . ,i
N
j
1
, . . . ,j
N|
where summation over identical indices is assumed, and |··| represents an outer product.
The evaluation of a single amplitude, e.g., the calculation of one of the Cj
Such codes (implementations) based on tensor network graphs allow more flexibility and can surpass a 50 qubit limit. Their problem, however, is an inefficient handling of diagonal matrices and higher order tensors. In particular, in a traditional tensor notation, there is no difference in representation of a diagonal tensor, e.g., a controlled-Z gate cZiijj=Ci,ji,j, and a non-diagonal tensor Uijkl=Cj,li,k. Here a diagonal tensor is a tensor for which Cj
C=C
j
, . . . ,j
i
, . . . ,i
|i
1
, . . . ,i
N
i
1
, . . . ,i
N|,
and which thus can be represented by a diagonal matrix acting on a N qubit-system.
Additionally, it is harder to adapt programs based on tensor network graphs to efficiently utilize modern parallel hardware.
From an arbitrary quantum circuit a corresponding tensor network may be obtained as follows. First, said quantum circuit is expressed in terms of one-qubit and two-qubit gates, for instance in terms of Hadamard gates, controlled X gates (cX, also called controlled NOT gate, CNOT), and π/8 gates, which is always possible to an arbitrary accuracy. However, it is noted that this is merely an illustrative example and the present disclosure is not limited to a particular set of gates used to describe the quantum circuit. In general, any set of gates, even n-qubit gates with arbitrary n (in particular also gates with n>2), may be used to describe the quantum circuit and the advantages of the present disclosure can be achieved.
Then, the individual one-qubit and two-qubit gates are expressed as
U
d1=Σiϵ{0,1}ψU
U
n1=Σi,jϵ{0,1}ψU
U
d2=Σi,jϵ{0,1}ψU
U
n2=Σi,j,k,lϵ{0,1}ψU
where the ψU
Furthermore, as can be seen from the above formulas, even diagonal quantum gates introduce new variables/qubit states. However, using the orthonormality of the computational basis, these qubit states can be immediately removed from a tensor expression of a quantum circuit. They, are in the following, as further explained below, referred to as non-unique qubit states. For instance, a diagonal one-qubit gate Ud1 followed by a non-diagonal one-qubit gate Un1 can be simplifies as
U
n1
U
d1=Σi,j,kϵ{0,1}ψU
where the ψU
The circuit tensor Cj
Here, one may assume that non-unique qubit states may already been removed, i.e., the sum runs only over variables bkl, that correspond to unique qubit states (otherwise, some of the functions ψ1 would comprise delta functions δ(bkl, bmn), and the sum would run over non-unique qubit states as well).
It is noted that N may also be the number of output qubits of the circuit that the number of input qubits and the number of output qubits may be the same. Furthermore, for each of the Boolean variables bkl, the subscript k enumerates the qubits (e.g., the enumerates horizontal lines in
This is also illustrated in
In the above, we took the point of view that all horizontal that are labelled with a bij having the same subscript i correspond to a single/same qubit. In other words, the state |bkl is considered to correspond to the l-th state of the k-qubit (for instance, |b10 and |b16 to be the input and output state of the first qubit, respectively).
However, in the present disclosure, the input state |bk0 of the k-th, the output state |bkd
Moreover, in the above formula, each of the functions ψ1, . . . , ψμ is one of the functions ψU
In particular, diagonal one-qubit gates, non-diagonal one-qubit gates, diagonal two-qubit gates, and non-diagonal two-qubit gates are represented as tensor of rank 1, 2, 2, and 4 respectively. It is also noted that, since at this point the computation of the amplitude tensor (or particular amplitude(s) of said tensor) is a mere multiplication and addition of complex numbers, it not necessary to distinguish between upper and lower indices of the tensors (e.g., we may write Ci
Finally, there are codes based on graphical models (e.g., of a tensor network corresponding to a given quantum circuit), which overcome previous problems. These codes make use of tensor network graphs to optimize the evaluation. In other words, in these graphical models, the tensor networks are expressed as graphs, advantageously undirected and/or simple graphs, which is explained below with reference to
In other words, in the traditional representation/graph, vertices representing tensors that have a common index are connected by an edge. Furthermore, for each tensor in the tensor network, there may be a vertex in a corresponding traditional graph. In general, there is a one-to-one correspondence of vertices and tensors. However, for one index of the tensor network there may be multiple corresponding edges. For instance, if an index appears on three tensors, there will be three edges connecting vertices that correspond said three tensors. Furthermore, each two vertices that correspond to tensors that share an index, are connected by an edge. Thus, the tensors that share an index correspond to a clique (fully connected subgraph) in the traditional graph.
Here it is noted that, in general, “a subset of vertices is/forms a clique” may mean that each vertex of said subset is connected with each other vertex of said subset. It is further noted that the terms “connected” “joined” or “linked” in expressions of the form “two vertices are connected” are here used interchangeably. Furthermore, the terms “node” and “vertex” are used interchangeably. Moreover, a “neighbor” of a first vertex is another, second vertex that has a common edge with said first vertex; and a vertex neighboring a first vertex, is a neighbor of the first vertex.
In the illustration of the traditional representation in
In other words, in the graphical representation, vertices of indices that have a common tensor are connected by an edge. Furthermore, for each unique index in the tensor network, there may be a vertex in a corresponding graphical representation. In general, there is a one-to-one correspondence of vertices and unique indices.
It is noted that the term “unique indices” refers to mutually different indices. That is to say, multiple tensors may have an index in common, and an index appearing on multiple tensors counts as only one unique index. For instance, the example expression ΣijkAij·Bjk·Cikl has the four unique indices i, j, k, and l. In general, when clear from the context, the term “unique” may be omitted herein.
However, there is in general no one to one correspondence between the tensors and the edges of the graph. In other words, for one tensor of the tensor network there may be multiple corresponding edges. For instance, if a tensor has more than three mutually different indices, there will be an edge for each pair of vertices corresponding to said different indices. All of these edges correspond to said tensor (and vice versa). Thus, each tensor corresponds to a clique (fully connected subgraph) in the graphical model.
In the illustration of the graphical model in
Henceforth, the graphical model is used.
The contraction of an index corresponds to the removal of the node in a graph, and to the introduction of connections between all its neighbors. This is illustrated in
It is noted that, in general, contraction of a tensor network refers to removing one or more indices by performing the corresponding summation(s). In analogy, the contraction of an index of a tensor network means removing the index by performing the summation over said index. For instance, in the example expression ΣijkAij·Bjk·Cikl, the contraction of the index k corresponds to performing the summation over k:
As can be seen in the contracted tensor network ΣijAij·Dijl, there is no index k.
The new tensor Dijl is explicitly given as Dijl=ΣkBjk·Cikl. In general, a contraction of an index may yield a new tensor. Thereby, all tensors sharing the contracted index may be merged into the new tensor. Thus, in general, a contraction may also remove all tensors from the tensor network that have the contracted index. In other words, these tensors will not appear in the contracted tensor network.
A new clique represents a new tensor, formed after the contraction of the respective index. In other words, in the contracted tensor network, there is a new tensor, where “new” means that a same/identical tensor is not present in the tensor network before contraction. The indices of said new tensor correspond to the vertices of the neighbors of that vertex that corresponds to the contracted index.
For instance, as can be seen in the example illustrated in
In general, the evaluation of the amplitude expression σk=ek|ψ=ek|Cd·Cd-1 . . . C1|ϕ amounts to the complete contraction of the corresponding tensor network. In graph terms, this corresponds to the elimination of all nodes in the graph. As for instance shown in [2], an optimal sequence of contractions can be calculated through the tree decomposition of the expression's graph. The dimension of the maximal intermediate tensor is given by the treewidth. Thus the treewidth corresponds to the quality of the solution (the elimination sequence).
In the following, the use of graphical models in the analysis of complete tensor network contractions is now demonstrated with reference to
The full contraction of this tensor network may be performed by going through the following steps
1) ΣiAijCikl=Tjkl1
2) ΣjBjkTikl1=Tkl2
3) ΣkDkmTkl2=Tlm3
4) ΣlDlnTlm3=Tnm4
5) ΣmTnm4Fmn=Tn5,
6) ΣnTn5=σ
In particular, in steps 1), 2), 3), 4), 5), and 6) a contraction of the index i, j, k, l, m, and n is performed respectively. Furthermore, the graph obtained after step 1), 2), 3), 4), 5), and 6) is illustrated in
However, the numerical cost of the operations crucially depends on the size of the intermediates, or the size of maximal cliques in the graphical model. For instance, to evaluate an intermediate tensor T with K variables/indices of size L (e.g., assuming L different values when performing the summation) one may have to spend LK+1 multiplications (e.g., when two tensors enter the intermediate tensor). Furthermore, the resulting intermediate tensor will have LK entries. Furthermore, a virtual tensor of rank K+1 may be formed. Here and in the following, the term “virtual tensor” refers to a tensor that may be built in the computer memory during performing the contraction of an index. More generally, term “virtual tensor” refers to the computational cost and memory requirements required for performing a contraction step.
For instance, in the above step 1), the intermediate tensor Tjkl1, which has 3 indices of size 2, is evaluated. This may require 24=16 multiplications and 23=8 additions. This may be implemented by first building/computing first a virtual tensor Vijkl1=AijCikl, which is of size 4. Here, each of the 16 entries of the virtual tensor corresponds to the result of the respective multiplication. Then, the virtual tensor may be contracted according to ΣiVijkl1=Tjkl1.
Different sequences of contractions may lead to different intermediates (but the same result). In particular, the complexity of the computation (e.g., represented by the memory/RAM required to perform the amplitude calculation) crucially depends on the size of maximal cliques in the intermediate graphs. Thus, the analysis of tensor network graphs can be used to efficiently perform the simulation of quantum circuits.
It is noted that the terms “intermediate graphs” and “intermediate tensor networks” of an elimination order refers to those graphs/tensor networks obtained after performing, in accordance with said elimination order, the first one or more but not all of said two or more contractions. The intermediate graphs do not include the original/uncontracted graph and the final graph. For instance, in
It is further noted that, in general, in an elimination order each vertex/index may only appear once. Thus, in general, an elimination order of a subset C⊆V of vertices V of a graph G (V, E) with vertices V and edges E is a bijection π: C→{1, 2, . . . , |C|}. Alternatively, π can be considered to be set of pairs of vertices and indices: π={(Ci, i)}i=1|C|, where C={c1, c2, . . . , c|C|}. Furthermore, we may express an elimination order of indices of a set of indices I={i1, i2, . . . , i|I|}, which formally is a bijection π: I→{1, 2, . . . , |I|}, as π=[π−1(1)π−1(2) . . . π−1(|I|)], (e.g., such an expression may read π=[jlmikn]). Moreover, it is noted that a graph here generally is an ordered pair G(V,E) of a set of vertices V={v1, v2, . . . , v|V|} and a set of edges E={e1, e2, . . . , e|E|}, where each edge corresponds to a pair of vertices of said graph ei={ve
In general, the contraction of two or more indices may be performed in any order. That is to say, independently of the order, after contracting all of said two or more indices the same tensor network and the same graphical model will be obtained. In short, any order yields the same result. However, the intermediate graphs and tensor networks in general depend on the order in which the contractions are performed.
In other words, different elimination sequences result in intermediates of different dimension, for instance, in intermediate tensors of different rank and/or different intermediate graphs. This is illustrated in
In
Since the maximal rank of the intermediate tensors corresponds (e.g., is equal) to the maximal size of a clique that corresponds to a single intermediate tensor, the maximal size of cliques in the elimination sequence that corresponds to a single intermediate tensor is particularly relevant for the computational complexity of an elimination sequence.
For instance, assume that an index that appears once on each of 3 initial tensors of rank r1, r2, and r3, respectively, is contracted. The resulting tensor, which may be an intermediate tensor, will have rank r=r1+r2+r3−3. However, whereas only 2r
The sequence of variable/index eliminations, which corresponds to the smallest computational complexity will thus have intermediate tensors with the smallest possible maximal rank. In the graphical model, the elimination sequence that corresponds to the smallest possible intermediate tensors may be calculated from a tree decomposition of the initial graph, e.g., from a graph corresponding to the uncontracted tensor network).
The tree decomposition of a graph G can be formulated as finding such a numeration of nodes that the size of the maximal clique (or the maximal treewidth) in the elimination sequence is minimal. As explained below, such an elimination sequence may be used to construct from the initial graph a chordal graph that has a minimal treewidth (or minimal maximal clique) among chordal graphs that can be constructed from said initial graph.
It is noted that, strictly speaking, only an elimination sequence which corresponds to smallest possible intermediate tensors and/or corresponds to the smallest possible treewidth of the resulting chordal graph is an optimal elimination sequence. In other words, strictly speaking, among all elimination sequences that eliminate the same two or more nodes of a given graph, the maximal clique (e.g., corresponding to a single intermediate tensor) in the intermediate graphs of an optimal elimination order is minimal. In general, there may be more than one optimal elimination order that minimizes the maximal rank of the intermediate tensors.
However, in particular in view of the fact that finding an optimal elimination order is an NP-Hard problem, in real applications the optimal elimination order will frequently be not a truly optimal elimination order, but only some approximation. In the present disclosure, such an approximation is also referred to as an optimized elimination order. In general, an optimized elimination sequence may be the result of some (e.g., heuristic) optimization process and not necessarily actually minimizes the maximal clique in the resulting chordal graph and/or minimizes the maximal intermediate tensor. In consequence, the chordal graph constructed using an optimized elimination sequence may have only a substantially minimal treewidth or, in other words, may have only a minimized treewidth. However, in some embodiments, the optimized elimination order is an optimal elimination order. In other words, the optimization procedure used to determine the optimized elimination order may be a procedure that surely yields an optimal elimination order.
The construction of a graphical model of a quantum circuit is now illustrated with reference to
In particular, each of the lines denoted as b10, b20, b30, and b40 corresponds to one of the four input qubits of the quantum circuit 700, and each of the lines denoted as b16, b25, b35, and b46 corresponds to one of the four output qubits of the quantum circuit 700.
The remaining qubit lines (horizontal lines) correspond to intermediate qubits. Here, in general, the term “intermediate qubit” or “internal qubit” refers to a two-state quantum system used to describe the quantum circuit that corresponds neither to an input nor an output qubit (state). In other words, an intermediate qubit is a qubit between two (non-diagonal) quantum gates in (or within) a quantum circuit (e.g., a virtual qubit). However, only a non-diagonal quantum gate may introduce a new unique qubit states and, thus, a new intermediate qubit. In other words, if a given qubit is in either state |0 or |1 before a diagonal quantum gate, said given qubit will be in the same state after said diagonal quantum gate (only the phase of said state may have changed). Thus, if a two indices bkl and bmn correspond to the same qubit state.
For instance, in
Furthermore, the boxes labelled as H indicate Hadamard gates, which are non-diagonal one-qubit gates; the boxes labelled as X1/2 indicate X1/2 gates, which are non-diagonal one-qubit gates; the boxes labelled as Y1/2 indicate Y1/Z gates, which are non-diagonal one-qubit gates; and the boxes labelled as T indicate T gates (also referred to as π/8 gates), which are diagonal one-qubit gates.
Finally, each pair of dots (labelled as cZ) connected by a vertical line indicates a controlled Z gate, which is diagonal two-qubit gate. The two qubits lines connected by a cZ gate are the qubits on which said cZ gates acts. Here, one of these qubits (for instance, the upper qubit) is the control qubit, and the other qubit is the target qubit on which a Z operation may be performed depending on the state of the control qubit.
a) to d) illustrate exemplary representations of diagonal one-qubit gates, non-diagonal qubit gates, diagonal qubit gates, and non-diagonal two-qubit respectively.
As can be seen, in the graphical model, the qubits of the quantum gates are represented as vertices, and the vertices corresponding to the qubits of a quantum gate are represented as a clique. As indicated in
It is noted that correspondingly, for each quantum gate of the quantum circuit, there may be a corresponding tensor of the tensor network. Said tensor may have, for each qubit of said quantum gate that is either an intermediate qubit or in the indicated subset (an indicated qubit), one index that corresponds to said qubit. The present disclosure is not limited to any particular quantum gate representation. The quantum circuit may in general be represented by elementary gates and by composite gates which include more than one elementary gates.
As explained above, graphical models offer a more economical representation of the diagonal quantities and reveal computational savings in the evaluation of the expression. However, up to now, graphical model based approaches have been mainly applied to the evaluation of a single amplitude at a time.
In view of the above, an aim of the present disclosure is to facilitate the efficient evaluation/computation, based on graphical models, of any subtensor of the amplitude tensor of the circuit matrix of a quantum circuit (e.g., any subset of entries/amplitudes).
It is noted that the term “subtensor” in general refers to a tensor that can be obtained from one of the amplitude tensors ψi
It is further noted that, if the initial state |ϕ corresponding to |ψ is a basis vector of the computational basis, ψi
Therefore, according to a first embodiment, an apparatus for simulating a quantum circuit is provided. The apparatus further includes a processing circuitry configured to receive an indication of a subset of qubits, the qubits being the input and the output qubits of the quantum circuit. The indicated subset corresponds to an amplitude tensor of the quantum circuit that is to be determined, wherein the amplitude tensor comprises amplitudes for different combinations of states of the qubits of the indicated subset. The processing circuitry is further configured to determine, using a tensor network of the quantum circuit and Restricted Maximum Cardinality Search (RMCS), an (optimal/optimized) elimination order of intermediate qubits within the quantum circuit. Moreover, the processing circuitry is configured to determine the amplitude tensor by removing, successively in accordance with the elimination order, that indices of the tensors of the tensor network that correspond to the intermediate qubits from the tensor network.
Furthermore, according to a second embodiment, a method for simulating a quantum circuit is provided. The method comprises a step of receiving an indication of a subset of input and output qubits of the quantum circuit, the indicated subset corresponding to an amplitude tensor of the quantum circuit that is to be determined, the amplitude tensor comprising amplitudes for different combinations of states of the qubits of the indicated subset. Furthermore, the method comprises a step of determining, using a tensor network of the quantum circuit and Restricted Maximum Cardinality Search, RMCS, an elimination order of intermediate qubits within the quantum circuit. Moreover, the method comprise a step of determining the amplitude tensor by removing, successively in accordance with the elimination order, that indices of the tensors of the tensor network that correspond to the intermediate qubits from the tensor network.
Moreover, according to a third embodiment, a computer program product including instructions stored on a non-transitory storage medium is provided. Said computer program performs, when executed on one or more processors the method according to the second embodiment.
An apparatus is capable to simulate a subsets of amplitudes of a quantum circuit, e.g., through a partial contraction of a tensor network. Here, simulating may mean computing one or more entries of an amplitude tensor of the quantum circuit, e.g., of the above-mentioned circuit tensor Cj
The amplitude tensor determined in the present implementation may be a subtensor of the circuit tensor Cj
Such partial contractions appear during circuit simulation if one is interested in determining a plurality of amplitudes of the circuit tensor at once (e.g., jointly).
For instance, assuming a 4-qubit quantum circuit, one may be interested to calculate the probabilities/amplitudes of both the qubit-strings b1=0001 and b2=1001 (differing in the first qubit) in a single pass of the (used) simulator. In other words, one is interested to determine the amplitude that the output qubits are in the states 0, 0, 0, and 1, respectively, as well as to determine the amplitude that the output qubits are in the states 1, 0, 0, and 1, respectively. It is further noted that in the present example the indicated subset consists of a single qubit, the first qubit. The basis vectors corresponding to the two qubit-strings are:
e
0001=|0⊗|0⊗|0⊗|1
e
1001=|1⊗|0⊗|0⊗|1
Both of these vectors may then be combined into a single expression, by stacking vectors e0001 and e1001 into a matrix column-wise:
The amplitudes of both b1 and b2 can be calculated similarly to the single amplitude approach:
σλ=[σ1001σ0001]=Eλ|C|ψ.
Here the index λ denotes which one of the two amplitudes is addressed. The expression above amounts to a partial contraction of a tensor network (all indices are summed except λ). This argument can be followed to include all qubit-strings which differ in 2, 3 or more qubits, up to the number of qubits in the circuit. It is possible to calculate any subset of amplitudes, up to the full state, in a similar way.
In general, one may be interested to determine an amplitude tensor that corresponds to an arbitrary subset (e.g., the indicated subset) of input qubits and/or output qubits (and vice versa). Said amplitude tensor corresponds to the indicated subset as explained below.
Here, it should be noted that, in general, i) the terms “amplitude tensor that corresponds to the indicated subset”, “amplitude tensor is of the subset” and “subset tensor” are used interchangeably; ii) qubits in the indicated subset are also referred to as indicated qubits; iii) input qubits and output qubits that are not in the indicated subset are also referred to as complementary qubits; and that iv) the set consisting of the complementary qubits is also referred to as the complementary subset.
In general, the indices of the subset tensor, which assume one of the values 0 and 1, may correspond to the indicated qubits in a one-to-one correspondence.
Furthermore, the subset tensor may correspond to a particular states of the complementary qubits. In general, for each complementary qubit this particular state may be predefined, predetermined, or may be indicated (e.g., together with the indicated subset). For instance, the subset tensor may correspond to an input state in which all input qubits are in the |0 state. The entries of the subset tensor may be (the) amplitudes corresponding to said particular states of the complementary qubits. Moreover, for each combination of index values, the respective entry of the subset tensor may be the amplitude corresponding to i) complementary qubits in the respective particular states, and ii) indicated qubits in the states corresponding to the combination of index values. The subset tensor may be a subtensor of the circuit tensor Cj
The advantage of using RMCS to determine an elimination order of the intermediate qubits (or a contraction order of the indices of the tensor network) is that any subset of amplitudes starting from a single amplitude up to the full state vector can be evaluated with minimal/minimized possible requirements in terms of memory and/or processor cycles on a single processor. In other words, a quantum circuit simulator according to the preset disclosure facilitates the simulation of multiple amplitudes in a single pass of the (used) algorithm (e.g., jointly). Thus, the novel feature of this simulator is the ability to evaluate any subsets of amplitudes (up to the full state vector) in a single pass. Furthermore, this approach is easy to parallelize [4].
In general, multiple amplitudes can be evaluated by partial contraction of the corresponding tensor networks (not all variables in the expression are summed). However, in contrast with the single amplitude approach, it has not been known how to choose the proper order of summations to achieve minimal/minimized computational cost, and no multiple amplitudes/full state simulators were created.
More specifically, if during the contraction of a tensor network we stop before summing all variables in a sequence, then the result will be a partial contraction of the network. Suppose that in the example above the optimized elimination sequence was found to be π=[ijklmn], which is the elimination sequence illustrated in
It is noted that the optimized elimination sequence π=[ijklmn], is not an optimal elimination sequence, i.e., has the smallest possible intermediate tensors. For instance, the elimination sequence μ=[jiklmn] has no intermediate tensor of rank 3 and thus a lower complexity than the elimination sequence π=[ijklmn], which computes in step 1) the rank-3 tensor Tjkl1.
If we followed the sequence π=[ijklmn] and contracted all variables in the expression before [mn], then the result is a partial contraction of a tensor network:
E
ijkl
A
ij
·B
jk
·C
ikl
·D
km
·E
ln
·F
mn
=T
mn
4.
To perform arbitrary partial contractions, however, we would need to transform elimination sequences without increasing the size of the intermediates. Namely, if a set of variables should be excluded from the summation, we need to find a new elimination sequence such that this set is placed at the end.
In other words, one may be interested only in those amplitudes that correspond to a particular external (input/output), for instance, the k-th qubit being in either state |0 or |1. These external qubits correspond to (e.g., are) the complementary qubits. Then, one may set in the formula
the index ik or jk that corresponds to said k-th external qubit to the value, 0 or 1, that corresponds to said state. Since there is a delta function (or, rather Kronecker-delta) for each index of an external qubit, the summation over the corresponding Boolean variable bkd
Thus, in general, the indices corresponding to either an input qubit that is not in the indicated subset or an output qubit that is not in the indicated subset may be removed, from the tensor network, by setting the indices to respective predetermined values. Furthermore, the indices corresponding to the intermediate qubits may be removed, from the tensor network, by contraction. Advantageously, before removing the indices corresponding to the intermediate qubits, the indices that correspond to the complementary qubits are removed from the tensor network.
In principle, the indices/vertices of complementary qubits may be removed at any time. However, advantageously, this is done rather sooner than later as it reduces the complexity of further operations. Alternatively, a tensor network and/or graphical model may be constructed after knowing the set of complementary qubits. In this case, indices/vertices corresponding to complementary qubits may not have to be introduced in the first place.
In any case, advantageously, the graph\tensor network based on which the optimized elimination order is determined by means of RMCS has no vertices \indices that correspond to complementary qubits.
Thus, in general, each intermediate qubit may uniquely correspond to a respective index of the tensors. Furthermore, each qubit in the indicated subset may uniquely correspond to a respective (unique) index of the tensors, and each index of the tensors may uniquely correspond to either an input qubit, an output qubit, or an intermediate qubit.
Here, as in the following, “each A uniquely corresponds to a B” means that two different A's do not correspond to the same B. It is further noted that, if the indices of the complementary qubits have not been removed from the tensor network, there may be a one-to one corresponds between qubits of the quantum circuit (internal and external) and unique indices of the tensor network.
If, on the other hand, the indices of the complementary qubits have been removed from the tensor network, there may be a one-to one corresponds between the non-complementary qubits (i.e., either indicated or internal qubits) and unique indices of the tensor network.
Furthermore, in general, there may be a one-to-one correspondence between the vertices of a graph representing a tensor network (of a quantum circuit) and that indices of the tensors that correspond to either an intermediate qubit or a qubit in the indicated subset.
It is noted that this, in particular, may be the case if the vertices corresponding to complementary qubits have been removed from said graph. If, in addition, the indices corresponding to complementary qubits have been removed from the tensor network, there may be a one-to-one correspondence between unique indices and vertices. It is further noted that there may also be a one-to-one correspondence between vertices and indices, if the indices corresponding to complementary qubits have not been removed from said tensor network and the vertices corresponding to said complementary qubits have not been removed from said graph.
It is further noted that, advantageously, the complementary qubits are removed from the graphical model/tensor network before determining the optimized elimination order of the complementary qubits.
Furthermore, in general, if the indices corresponding to complementary qubits have not been removed from a tensor network representing a quantum circuit, there may be a one-to-one correspondence between unique indices of said tensor network and the qubits of said quantum circuit. For instance, there is a one-to-one correspondence between the vertices of the graph of
To summarize the above, as far as the indicated qubits are concerned, one is generally interested in amplitudes for both states, |0 and |1, of the indicated qubits. Thus, indices/vertices of indicated qubits cannot be removed from the tensor network/graphical model (in particular, since, in order to evaluate the corresponding Kronecker-delta, one would have to choose one of the two states of the indicated qubit). Thus, in order to calculate one or more of the amplitudes Cj
Thus, when determining an optimized elimination sequence of the internal qubits, which is an elimination sequence that minimizes (in some sense) computational resources and/or memory requirements, the indicated qubits have to be taken into account. This may be done by determining an optimized elimination order of internal and indicated qubits subject to the constraint that the indicated qubits are at the end of said elimination sequence.
According to the present disclosure, an optimal/optimized elimination sequence for an arbitrary subset of amplitudes can be obtained using RMCS. One way to obtain an elimination sequence based on RMCS, are algorithms based on chordal graphs, as further explained below.
In this respect, it should be noted that in general: a chordal graph is a graph in which all cycles of four or more vertices have a chord; a chord is an edge that is not part of the cycle but connects two vertices of the cycle; a cycle is non-empty sequence of mutually different edges which joins a sequence of vertices, wherein, in the sequence of vertices, the only repeated vertices are the first and the last vertex (in other words the first vertex is the last vertex of the sequence are identical, and all other vertices are mutually different and different from the first/last vertex). In other words, a chordal graphs is a graph that does not contain cycles with more than 3 nodes.
The elimination order may be determined iteratively, in reverse order. This may done may selecting from the intermediate qubits, in each step of the iteration, an intermediate qubit that has not been selected in any preceding step of the iteration. The selected intermediate qubit further corresponds, in a chordal graph representing the tensor network, to a vertex neighboring a maximum number of vertices that correspond to either an intermediate qubit that has been selected in any preceding step of the iteration, or a qubit in the indicated subset.
In this way, given (as input) a chordal graph H=(V, {tilde over (E)}) and a (indicated) subset of nodes C⊂V, provided there is a clique on C (e.g., the nodes in C form/are a clique), it is possible to build a perfect elimination order {tilde over (π)}, such that S is at the end of {tilde over (π)}. Here it is noted that a perfect elimination order is, in general, an elimination order in that, for each vertex, the neighbors of said vertex that are higher numbered in said elimination order (e.g., eliminated later than said vertex) form a clique. In general, a graph has a perfect elimination order if and only if it is said graph is chordal.
Furthermore, since the elimination order {tilde over (π)} is a perfect elimination order of the chordal graph H=(V, {tilde over (E)}), if the maximal clique in H=(V, {tilde over (E)}) has the size K+1, then the maximal rank of the intermediate tensors appearing in the elimination sequence {tilde over (π)} will be K. In other words, if the maximal clique in the chordal graph H=(V, {tilde over (E)}) has size K, then the order of the maximal virtual tensor in the elimination sequence is also K.
An exemplary implementation of the construction 1070 of the elimination order {tilde over (π)} using RMCS is now described with reference to the pseudocode shown below:
As can be seen, for each node in the graph H, a counter (in the pseudocode denoted as cardinality(v)) holding the number of already enumerated neighbors of the node is introduced.
First, all of the nodes in C are enumerated in arbitrary order and update counters on all of their neighbors (lines 2 and 3). In other words, lines 2 to 4 of the pseudocode initializes the function cardinality(v): V→{0, 1, 2, 3, . . . } by setting, for each node, the value of said function to zero. Furthermore, according to line 5, the indicated subset of nodes C is removed from the set of vertices V.
Then, there is a loop (cycle) with the loop variable i, which executes the code of lines 7 to 16 a total of |V| times (since, according to line 6, i runs from i=|V| to i=1, one time for each vertex of H). During each execution of the said i-loop, one vertex of H is selected/picked (either line 8 or line 10 is executed). Since the selected vertex is also removed from the respective set (lines 8 and 11), no vertex can be selected twice and, thus, each vertex is selected exactly once.
According to lines 7 and 8, the nodes in the subset C are picked first. In other words, before any other node can be picked, the i-loop has to be executed |C| times and each odes in the subset C will be picked exactly once. Since the sequence {tilde over (π)} is constructed in reverse order, these nodes will be at the end of the sequence {tilde over (π)}.
According to lines 9 to 12, a node with maximal number of enumerated neighbors (in other words, a maximal cardinality) is selected and assigned with the next number. In general, ties may be broken arbitrarily. In other words, if two or more vertices have the same cardinality, either of said two or more vertices may be selected.
According to line 13, the node that has been selected in the current execution of the loop (line 8 or 10) is added to the elimination order {tilde over (π)} (at the i-th position of {tilde over (π)}).
According to line 14 to 16, the counters on all neighbor nodes are updated. In other words, the counter/cardinality of neighbors of the selected vertex that have not already been selected (e.g., have not already been added to {tilde over (π)}) is increased by one.
The elimination order {tilde over (π)} will be a perfect elimination order of the chordal graph H=(V,{tilde over (E)}), with the subset C at the end.
Graphically, the described algorithm is illustrated in
The letters in the vertices shown in
In particular, in step S1210, the vertex i is selected. It is noted that the selection of vertex i at step S1210 is arbitrary. Alternatively, vertex j may be selected instead of vertex i, which yields a perfect elimination sequence with the vertices i and j at the end as well. Vertex i assigned the 6th position in the elimination sequence π, and the cardinality of its neighbors that have not yet been selected (i.e., vertices jkl) is increased by one.
In step S1220, since vertex j is the only vertex in the vertex in the indicated subset that has not yet been selected, vertex j is selected. Vertex j is assigned the 5th position in the elimination sequence {tilde over (π)}, and the cardinality of its neighbors that have not yet been selected (i.e., vertices kl) is increased by one.
In step S1230, since vertex k has a maximum cardinality of 2 among the vertices that have not yet been selected (i.e., vertices klmn), vertex k is selected. Vertex k is assigned the 4th position in the elimination sequence {tilde over (π)}, and the cardinality of its neighbors that have not yet been selected (i.e., vertices lm) is increased by one. It is noted that at this step vertex l, which has like vertex k has a maximum cardinality of 2, may be selected instead of vertex k, as well. In this case the cardinality of all remaining vertices kmn would increase by one.
In step S1240, since vertex l is the only vertex with a maximum cardinality of 3 among the vertices that have not yet been selected (i.e., vertices lmn), vertex l is selected. Vertex l is assigned the 3rd position in the elimination sequence {tilde over (π)}, and the cardinality of the neighbors of vertex l that have not yet been selected (i.e., vertices mn) is increased by one.
In step S1250, since vertex m is the only vertex with a maximum cardinality of 2 among the vertices that have not yet been selected (i.e., vertices m and n), vertex m is selected, vertex m is assigned the 2nd position in the elimination sequence {tilde over (π)}, and the cardinality of the neighbors of vertex l that have not yet been selected (i.e., vertices n) is increased by one.
In step S1260, the only remaining vertex, vertex n is selected, and assigned the first position in the elimination sequence {tilde over (π)}. Thus, in total, the elimination sequence {tilde over (π)}=[ijklmn] is obtained.
Another exemplary implementation of the construction 1370 of the elimination order {tilde over (π)} using RMCS is now described with reference to
As before, input to the process of
First, in step S1310, a loop variable is set to i=|V|−|C|, and a set {tilde over (V)}=V \C, which comprises all vertices still have to be selected, is introduced. It is noted that, in general, i may be replaced by |{tilde over (V)}|, and thus is merely introduced for sake of clarity.
In step S1320, for all vertices that still have to be selected (all w in {tilde over (V)}), the cardinality of said vertex is updated to the c(w)=|{v|vϵN(w)∧v∉{tilde over (V)}}|, where N(w) is the set of neighbors of w, and ∧ denotes the logical AND. That is to say, the cardinality of a vertex w is set to the number of neighbors of said vertex that do not still have to be selected themselves, which is the number of neighbors that are either in the indicated subset C or have already been selected in a previous execution of the loop. It noted that, if i≠|V|−|C|, the cardinality may updated by incrementing (e.g., increasing by one) for all vertices that still have to be selected and that neighbor the vertex that has most recently been selected. For instance, for all wϵ{tilde over (V)}∩N(v), one may set c(w)=c(w)+1.
In step S1340, a vertex v of the vertices that still have to be selected (vϵ{tilde over (V)}) with a maximum cardinality among the vertices that still have to be selected is (arbitrarily) selected. The mathematical expression for the set of vertices from which the vertex v may be selected at this step is given as {v|vϵ{tilde over (V)}∧c(v)≥c(w)∀wϵ{tilde over (V)}}, where ∀ is the mathematical expression for “for all”.
It is noted that steps S1320 and S1340 may be combined by directly selecting a vertex v from the set {v|vϵ{tilde over (V)}∧|{y|yϵN(v)∧y∉{tilde over (V)}}|≥|{x|xϵN(w)∧x∉{tilde over (V)}}|c(w)∀wϵ{tilde over (V)}}
In step S1350, the selected vertex is added to the elimination sequence at the i-th position ({tilde over (π)}−1 (i)=v).
In step S1360, it is checked whether or not all vertices of H that are not in the indicated subset have be selected (i.e., included in the elimination order). In the present example, this done by checking whether or not i=1. Alternatively, for instance, the condition |{tilde over (V)}|=1 may be checked. If the i=1 (“Yes” in S1360) the process ends with the current elimination sequence {tilde over (π)} as output. It is noted that a perfect elimination order of all vertices of H may be obtained from the elimination sequence {tilde over (π)} by adding the vertices of C in any order at the end of π. Otherwise (“No” in S1360), after performing step S1380, which decrements the loop variable i (i=i−1), and removes the currently selected vertex from the set of vertices that have to be selected ({tilde over (V)}={tilde over (V)}\{v}), the steps S1320, S1340, S1350, and S1360, are executed again with updated loop variable i and set of vertices {tilde over (V)}.
The above described processes require the input graph H=(V, {tilde over (E)}) is a chordal graph. However, the graphical model, an initial graph G=(V, E) representing the quantum circuit may, a priori, not be chordal. For instance, the graph of the quantum circuit 700 shown in
In general, any graph can be made chordal by adding edges. In order to obtain a chordal graph H=(V, {tilde over (E)}) from the G=(V, E), edges may have to be added to the graph G, which is also known as a chordal completion of G. Thus, as already indicated, whereas the vertices of a graph G and its chordal completion H my be identical, the vertices of G are in general only a subset of the vertices its chordal completion H, i.e., E⊆{tilde over (E)}. In general, the chordal completion of a non-chordal graph is not unique and, in particular, different chordal completions of the same non-chordal graph may have a different treewidth (for instance, there is always the trivial completion by joining each vertex with each other).
Therefore, advantageously, a chordal graph representing a tensor network is a chordal completion of a non-chordal graph representing the tensor network that has a minimal/minimized maximal clique among chordal completions of said non-chordal graph.
In particular, advantageously, a chordal graph representing a tensor network is obtained from a non-chordal graph representing the tensor network using an optimized elimination order of the vertices of the non-chordal graph. In particular, the chordal graph may be obtained by adding edges to said non-chordal graph such that, for each vertex, all neighbors of the vertex that are later in the optimized elimination order than said vertex are a clique.
This chordal graph construction ensures that we don't change the complexity of found perfect elimination order. When a vertex is eliminated from the graph the same edges are added. This procedure doesn't change the treewidth by construction since we introduce edges which will be introduced during elimination anyway.
In general, any elimination order π may be used to build, from a given graph G, a chordal graph H, which is also known as the fill-in graph of G with respect to π. This can be done, e.g., by following said elimination sequence π, but instead of eliminating nodes and connecting their neighbors into cliques, one simply connects their neighbors which are later in the elimination sequence π. Note that this operation adds essentially the same edges to the graph as the original node elimination π, except that the nodes are not removed from the graph. It is noted that by adding only those edges to a graph becomes chordal, and the elimination sequence π will be a perfect elimination sequence of the obtained chordal graph. This may be done, for instance, according to the pseudocode shown below:
In particular, according to line 2 of the pseudocode, all edges of the input graph are also given to the output graph H.
Between lines 4 to 13 of the pseudocode, there is a loop with a loop variable i, which runs, according to line 3, from i=1 to i=|V|. In other words, the loop is executed once for each vertex in the elimination sequence. The following steps are performed during one execution of said loop. It is noted that, in the last two executions of the i-loop no edge is added to the graph H. In other words, the loop variable i may run only from i=1 to i=|V|−2 without changing the output graph H.
In line 4 of the pseudocode, the next node in the elimination sequence is determined (henceforth denote as the current node). Furthermore, according to line 5, an auxiliary set U is defined, and initialized/reset to being the empty set.
Then, according to lines 6 to 10 of the pseudocode, all neighbors of the current node (line 6) that are later in the elimination sequence than the current node (line 7) are included in the auxiliary set of vertices U (line 8).
Thereafter, according to lines 11 to 13 of the pseudocode, the vertices in U are made to a clique. More specifically, for every pair of (different) vertices (line 11), it is ensured that the set of edges {tilde over (E)} of H comprises an edge.
The resulting graph H=(V, {tilde over (E)}) (after performing the loop |V| times) is chordal. Furthermore, if the rank of the maximal intermediate tensor is K in the elimination sequence π, then the maximal clique is K+1 in the corresponding chordal graph H=(V, {tilde over (E)}). In other words, if the order of the maximal virtual tensor in the elimination sequence π is K, then the maximal clique in the corresponding chordal graph is also K.
It is further noted that, in consequence, the order of the maximal virtual tensor in the elimination sequences π and {tilde over (π)} is the same, and thus the computational complexity of the elimination sequences π and {tilde over (π)} is the same. In other words, since the constructed sequence {tilde over (π)} will have the same complexity as the elimination sequence π used to construct the chordal H, the above-explained construction of {tilde over (π)} does not increase the computational complexity. The elimination order π may thus be seen as an input (along with the non-chordal graph G) to the construction of the sequence {tilde over (π)}, which will be computationally of the same complexity as π and have the specified subset of vertices is placed at the end. This holds independently of the computational complexity of the sequence π, and in particular regardless whether or not the optimized elimination order π was an optimal elimination order. Actually, as already noted above, since finding an optimal elimination order is an NP-Hard problem, in real applications π will frequently be not a truly optimal elimination order, but only some approximation (here also referred to as an optimized elimination order). The constructed sequence {tilde over (π)} will then be optimized/optimal to the same degree as the elimination order π used to obtain the chordal graph H.
In the following, the above pseudocode is illustrated with reference to
In particular, steps S1110, S1130, S1150, S1170, and S1190 correspond respectively to the first to fifth execution of said of lines 4 to 13 of the pseudocode. The last execution of the loop, which may be omitted anyway is not illustrated in
In step S1110, it is ensured that the neighbors of the current vertex i that are later in the elimination sequence (i.e. vertices jkl) are a clique. Since there is no edge connecting vertex j and l in the graph of
In step S1130, it is ensured that the neighbors of the current vertex j that are later in the elimination sequence (i.e. vertices kl) are a clique. Since there is already an edge connecting these vertices in the graph of
In step S1150, it is ensured that the neighbors of the current vertex k that are later in the elimination sequence (i.e. vertices lm) are a clique. Since there is no edge connecting vertex l and m in the graph of
In step S1170, it is ensured that the neighbors of the current vertex l that are later in the elimination sequence (i.e. vertices mn) are a clique. Since there is already an edge connecting these vertices in the graph of
In step S1190, it is ensured that the neighbors of the current vertex m that are later in the elimination sequence (i.e. vertices n) are a clique. However, as mentioned above, since there is only one vertex later in the elimination sequence than the vertex m, there is never a vertex to be added in this step. Consequently, the graphs shown in
Another exemplary implementation of the construction of a chordal graph H from a graph using an elimination sequence π is now described with reference to
Steps S1420, S1460, and S1450 essentially implement the frame of an loop with the loop variable i, and in said i-loop step S1440 is executed.
In particular, in step S1420 the loop variable is initialized as i=1, and all edges of the graph G are also given to the graph H ({tilde over (E)}=E).
In step 1460, the exit condition of the i-loop is checked (i=|V|−2?). If i=|V|−2 (“yes” in step 1460), the construction of the chordal graph H is finished. In particular, the current set of edges {tilde over (E)} are the edges of the chordal graph H=(V, {tilde over (E)}). If i≠|V|−2 (“no” in step 1460), the construction of the chordal graph continues with step S1450. Thus, S1440 is executed once for each iϵ{1, . . . , |V|−2}.
In step S1450, the loop variable is merely incremented by one (i=i+1). Then, step S1440 is executed (again).
In step S1440, edges are added to the set of edges {tilde over (E)}, such that, for all vertices x and y that are
a) neighbors of the i-th vertex in the elimination sequence (“x, yϵN((π−1(i))”),
b) mutually different vertices (“x≠y”), and
c) later than the i-th vertex in the elimination sequence π (“π(x)>i∧π(y)>i”, here “∧” is, as in general, the logical AND),
there is an edge (x, y) in the (updated) set of edges {tilde over (E)}.
Step S1440 may further comprise a step S1580, performed after step S1560, in which edges are added to the set of edges {tilde over (E)}, such that, for all vertices x and y of the auxiliary subset U (x, yϵU) that are mutually different vertices (“x≠y”) there is an edge (x, y) in the (updated) set of edges {tilde over (E)}.
This step may, for instance, be implemented as in the lines 11 to 13 of the above pseudocode for “Building chordal graph from the elimination order”.
Using an optimized elimination order to obtain a chordal graph H representing the quantum circuit from a non-chordal graph G representing the quantum circuit has the advantage that the chordal graph H will have a minimized maximal clique among chordal completions of said non-chordal graph. In other words, the resulting chordal graph H will be a chordal completion of G that has a minimized treewidth among the chordal completions of G.
First, in step S1700, an indication of a subset C⊂V of vertices of the graph G may be obtained. For instance, an indication of the indicated subset of qubits, which is a subset of the external qubits of the quantum circuit, may be obtained. Henceforth, as further explained below, {tilde over (G)} is assumed to be non-chordal and may be referred to being a non-chordal.
Then, in step S1710, a graph G=(V, E1) that represents the quantum circuit that is to be simulated may be obtained/received. Alternatively, the graph G=(V, E1) may be generated/determined, e.g., from a given/received tensor network expression. Alternatively or addition thereto, a graph G encoding the tensor network representing the quantum circuit may be created/generated first. Then, an amplitude expression (e.g., a tensor network) may be built as explained above. A graph G corresponding to this amplitude expression may then be constructed by the known algorithm from [3], [4]. As an outcome we have a graph G, where nodes represent variables, and cliques represent tensors in the tensor network. In particular, since there are transitive one-to-one correspondences between vertices, indices, and qubits of the quantum circuit, the subset C will be interchangeably referred to as a subset of vertices, indices, and qubits.
In general, the non-chordal graph {tilde over (G)} representing the tensor network may be determined in accordance with the indicated subset C. In particular, said non-chordal graph {tilde over (G)} may be determined such that there is a one-to-one correspondence between the vertices of the non-chordal graph {tilde over (G)} and that indices of the tensors that correspond to either an intermediate qubit or a qubit in the indicated subset.
Furthermore, said non-chordal graph {tilde over (G)} may be determined such that, for each tensor of the tensor network, the vertices of the non-chordal graph {tilde over (G)} that correspond to said tensor are a clique. In other words, step S1710 and S1720 may be combined.
For instance, the non-chordal graph {tilde over (G)} representing the tensor network may be determined, in accordance with the indicated subset C, from a generic non-chordal graph U representing the tensor network. More specifically, for each input or output qubit that is in the indicated subset C (i.e., for each indicated qubit), a single vertex that corresponds to said qubit may be added to the vertices of U. Furthermore, for each indicated qubit, edges may be added such that, for each quantum gate of the quantum circuit, that vertices of the non-chordal graph that correspond to qubits of said quantum gate are a clique. Moreover, there is a one-to-one correspondence between the vertices of the generic non-chordal graph U and the intermediate qubits. For instance, the subgraph of
Alternatively, the non-chordal graph {tilde over (G)} representing the tensor network may be determined, in accordance with the indicated subset C, from a universal non-chordal graph Ũ representing the tensor network. More specifically, for each input or output qubit that is not in the indicated subset (i.e., for each complementary qubit), all edges connecting a vertex that corresponds to the qubit, and all vertices that correspond to the qubit may be removed from Ũ. Moreover, there is a one-to one-correspondence between the vertices of the universal non-chordal graph Ũ and qubits of the quantum circuit, wherein each qubit of the quantum circuit is either an input qubit, an output qubit, or an intermediate qubit. In other words, there is a one-to-one correspondence between vertices of Ũ and the qubits of the quantum circuit, the qubits of the quantum circuit being the indicated, complementary, and intermediate qubits. For instance, the entire graph shown in
For instance, in the above steps S1700 and S1710, the quantum circuit may be read and a set of (external) qubits for which all amplitudes are required may be selected by a user. In other words, a user may select\indicate a subset of nodes C corresponding to indices that are not going to be contracted. It further noted that the order of step S1700 and S1710 may be interchanged, or both steps may be performed simultaneously.
Then a step S1750, in which, using a tensor network of the quantum circuit and RMCS, an elimination order {tilde over (π)}: V\C→{1, 2, . . . , |V|−|C|} of intermediate qubits within the quantum circuit is determined. Alternatively, an elimination order {tilde over (π)}: V→{1, 2, . . . , |V|}, but with the indicated set of nodes C at the end, may be determined. The step S1750 may include the steps S1720, S1740, S1760, and S1770. Furthermore, if the graph G=(V, E1) and/or the tensor network representing the quantum circuit are determined (or modified) in step S1710, step S1710 may also be considered part of step S1750.
Then, in step S1720, edges may be added to the graph G, such that the vertices corresponding to the indicated qubits are a clique. In other words, if there is no clique on the set C, then edges are added to form it. We get a graph {tilde over (G)}=(V, E2) where there is a clique on the nodes in C. In other words, a clique (if a clique did not already exist) is introduced on those nodes denoting/corresponding to variables that will not be eliminated. In other words, advantageously, before determining an optimized elimination order π, the non-chordal graph {tilde over (G)} s modified by adding, to the non-chordal graph {tilde over (G)}, edges such that the vertices corresponding to the qubits of the indicated subset are a clique. In the original graph G, a clique connecting the vertices corresponding to the target subset C of qubits is introduced. This results in a graph {tilde over (G)}, which may have a treewidth that is larger than the treewidth of G. It is noted that step S1720 may, advantageously, be omitted if the vertices corresponding to the subset C already are clique of G. In this case the following steps may be performed using {tilde over (G)}=G.
Then, in step S1740, an optimized elimination π of the graph {tilde over (G)} may be determined. It is noted that, advantageously, if the graph {tilde over (G)} is already a chordal graph, this step as well as the following step, (i.e., steps S1740 and S1760) are not performed. In this case, steps S1740 and S1760 may be omitted, and, after step S1720, step S1770 may be performed using H={tilde over (G)}. However, in the following, it is assumed that {tilde over (G)} is a non-chordal graph.
In general, the optimized elimination order π of the vertices of the non-chordal graph representing the tensor network may be determined using an optimization procedure. In general, the optimization procedure may minimize a maximal clique of the corresponding fill-in graph. The corresponding fill-in graph is the fill-in graph of the non-chordal graph {tilde over (G)} with respect to the optimized elimination order π. Said fill-in graph may be obtained from the non-chordal graph {tilde over (G)} by adding edges to the non-chordal graph {tilde over (G)} such that, for each vertex of the fill-in graph, all neighbors (in the fill-in graph) of said vertex that are later in the optimized elimination order than said vertex are a clique in the fill-in graph. In general, a fill-in graph is a chordal graph. Thus, in other words, the optimization procedure may minimize the maximal clique/treewidth of the resulting chordal/fill-in graph.
For instance, in step S1740, an elimination order π may be determined by computing a tree decomposition with minimized treewidth (most computationally intensive part, NP-hard problem). The tree decomposition of the graph {tilde over (G)} may be found using any of the many available algorithms and methods. As a result we obtain an optimized elimination order π of the vertices of {tilde over (G)}. In other words, in general, the determining of the (optimized) elimination order of the intermediate qubits may include determining an optimized (e.g., optimized with respect to the edges of {tilde over (G)}) elimination order π of (all) the vertices V. It is noted that this optimized elimination order π corresponds to an elimination order of indicated and intermediate qubits.
In general, the optimized elimination order π of the vertices of the non-chordal graph {tilde over (G)} representing the tensor network may be determined such that it minimizes a maximal intermediate treewidth (e.g., maxtw(π)≤maxtw(λ), for all λ that are an elimination order of {tilde over (G)}). Here the maximal intermediate treewidth maxtw(λ) of an elimination order is the maximal treewidth among treewidths of intermediate graphs that correspond to said elimination order λ. In other words, all intermediate graphs corresponding obtained from {tilde over (G)} and said elimination order λ have a treewidth equal to or smaller than maxtw(λ) (maxtw(λ) being an integer) and at least one of said intermediate graphs has a treewidth of maxtw(λ). In particular, each of the intermediate graphs corresponding to an elimination order λ may be obtained from the non-chordal graph {tilde over (G)} by eliminating, successively in accordance with said elimination order λ, the vertices corresponding to respective first n qubits in the elimination order λ. In other words, all vertices vi=λ−1(i), with i≤n are removed from {tilde over (G)} in the order v1, v2, . . . , vn. In general, n may be an integer larger than zero and smaller than the number |V| of the vertices of the non-chordal graph {tilde over (G)}. Furthermore, each vertex vi may be eliminated by removing, from said non-chordal graph {tilde over (G)}, all edges with an endpoint corresponding to the vertex vi, removing, from said non-chordal graph {tilde over (G)}, the vertex vi, and adding, to said non-chordal graph {tilde over (G)}, edges such that all neighbors of the vertex vi are connected.
The nodes from the set C, however, may not be at the end of π. However, as already explained above, a chordal graph H=(V, {tilde over (E)}), obtained from {tilde over (G)} using π, may be used as an intermediate to transform the elimination order π to have a specific set of nodes at the end. Any (elimination) ordering of nodes of a chordal graph that does not (when removing successively vertices and connecting the neighbors of the respective vertex) introduce new edges, and hence does not increase the size of the maximal clique, are computationally equivalent. Thus, the evaluation of tensor network contraction according to the orders π and {tilde over (π)} will be computationally equivalent. In other words, two perfect elimination orders of a graph are computationally equivalent. In this way, according to the present disclosure, a chordal graphs may be used to build, using RMCS, an equivalent elimination ordering for partial tensor network contraction. In other words, the order π can be transformed into it by the use of RMCS, such that the set of nodes C is at the end of {tilde over (π)}. This new ordering {tilde over (π)} is also perfect since any zero fill-in elimination ordering of a chordal graph has the same complexity. With chordal graphs it is possible to move a target subset C of vertices to the end of an elimination order with polynomial complexity. The procedure according to the present disclosure extends the usual MCS algorithm, as e.g., described in [5], facilitating placing a specified set of nodes C to the end of the sequence {tilde over (π)}.
Accordingly, in step S1760, using the graph {tilde over (G)} and π, a chordal graph H=(V, {tilde over (E)}), may be constructed/generated.
Then, in step S1770, using H and C, a perfect elimination order π: V\C→{1, 2, . . . , |V|−|C|} of that vertices of H that correspond to intermediate qubits may be determined. This a new elimination order {tilde over (π)} may be determined by the RMCS algorithm. This elimination order {tilde over (π)} may correspond, with respect to the indicated (external) qubits, to an optimized partial contraction order of the indices a tensor network representing the quantum circuit in terms of computational cost and/or memory. It is further noted that the subset C may be appended/added in any order to the elimination order {tilde over (π)}: V\C→{1, 2, . . . , |V|−|C|} and the resulting elimination order will be a perfect elimination order V→{1, 2, . . . , |V|} of H, and, in this sense, the elimination order {tilde over (π)} is referred to as being perfect.
Then, in step S1790, an amplitude tensor of/corresponding to the subset C may be determined. For instance, the tensor network may be (partially) contracted according to the order {tilde over (π)} (for example, with a bucket elimination algorithm). The contraction is terminated when all variables not in the set C are eliminated from the tensor network. The contraction is terminated when all variables not in the set C are eliminated.
Embodiments, e.g. the apparatus 1000 for simulating a quantum circuit, and functions described herein, e.g. with reference to the apparatus 1000, may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted over communication media as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to a tangible medium such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, e.g., according to a communication protocol. In this manner, computer-readable media generally may correspond to (1) tangible computer-readable storage media which is non-transitory or (2) a communication medium such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementation of the techniques described in this disclosure. A computer program product may include a computer-readable medium.
By way of example, and not limiting, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage, or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but are instead directed to non-transitory, tangible storage media. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Accordingly, the term “processor,” as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques could be fully implemented in one or more circuits or logic elements.
The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC) or a set of ICs (e.g., a chip set). Various components, modules, or units are described in this disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require realization by different hardware units. Rather, as described above, various units may be combined in a codec hardware unit or provided by a collection of inter-operative hardware units, including one or more processors as described above, in conjunction with suitable software and/or firmware.
The present disclosure provides embodiments for simulating a quantum circuit. In particular, an indication of a subset of input and output qubits of the quantum circuit is received. The indicated subset corresponds to an amplitude tensor of the quantum circuit that is to be determined, wherein the amplitude tensor comprises amplitudes for different combinations of states of the qubits of the indicated subset. Using a tensor network of the quantum circuit and Restricted Maximum Cardinality Search, RMCS, an elimination order of intermediate qubits within the quantum circuit is determined. The amplitude tensor is determined by removing, successively in accordance with the elimination order, that indices of the tensors of the tensor network that correspond to the intermediate qubits from the tensor network.
This application is a continuation of International Application No. PCT/RU2019/000727, filed on Oct. 11, 2019, which is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/RU2019/000727 | Oct 2019 | US |
Child | 17717914 | US |