Digital-Analog QFT (Advanced)
Following the work in the DAQC paper , the authors also proposed an algorithm using this technique to perform the well-known Quantum Fourier Transform . In this tutorial we will go over how the Ising transform used in the DAQC technique can be used to recreate the results for the DA-QFT.
The (standard) digital QFT
The standard Quantum Fourier Transform can be easily built in qadence
by calling the qft
function. It accepts three arguments:
reverse_in
(default False
): reverses the order of the input qubits
swaps_out
(default False
): swaps the qubit states at the output
inverse
(default False
): performs the inverse QFT
import torch
import qadence as qd
from qadence.draw import display
from qadence import X , I , Z , H , CPHASE , CNOT , HamEvo
n_qubits = 4
qft_circuit = qd . qft ( n_qubits )
# display(qft_circuit)
%3
28b19f02a4654d9bb3ff363492669fda
0
89aa4d7e06914f9ba37d03c6a2d8126b
H
28b19f02a4654d9bb3ff363492669fda--89aa4d7e06914f9ba37d03c6a2d8126b
a5180e58bcca4655b866849b13d48512
1
27d2e41dda034e54bbd75aa0dd0ffa24
PHASE(1.571)
89aa4d7e06914f9ba37d03c6a2d8126b--27d2e41dda034e54bbd75aa0dd0ffa24
4835f59f97264f1485143b78de7df657
PHASE(0.785)
27d2e41dda034e54bbd75aa0dd0ffa24--4835f59f97264f1485143b78de7df657
906f735409c046bba79547a8d9bcd931
27d2e41dda034e54bbd75aa0dd0ffa24--906f735409c046bba79547a8d9bcd931
a04618674c664d1594b1e846b7435857
PHASE(0.393)
4835f59f97264f1485143b78de7df657--a04618674c664d1594b1e846b7435857
b3c07f7643c34690b99dc07978e661e4
4835f59f97264f1485143b78de7df657--b3c07f7643c34690b99dc07978e661e4
0620d1c0382d445b9ed6d4d013b504c0
a04618674c664d1594b1e846b7435857--0620d1c0382d445b9ed6d4d013b504c0
e5b03ba7f0a2427fb1f034d0ac19fe1a
a04618674c664d1594b1e846b7435857--e5b03ba7f0a2427fb1f034d0ac19fe1a
da8a4626e4ea447180b92b4d74c249c9
0620d1c0382d445b9ed6d4d013b504c0--da8a4626e4ea447180b92b4d74c249c9
4ed79e2d92ea4630b78adb86d3e05bd9
da8a4626e4ea447180b92b4d74c249c9--4ed79e2d92ea4630b78adb86d3e05bd9
87f7f817e85b43bb80d2bde374795241
4ed79e2d92ea4630b78adb86d3e05bd9--87f7f817e85b43bb80d2bde374795241
37da9e2df6834b55bdc493a092417c17
87f7f817e85b43bb80d2bde374795241--37da9e2df6834b55bdc493a092417c17
acbe310caeeb42c4a53dde972d67d6cd
37da9e2df6834b55bdc493a092417c17--acbe310caeeb42c4a53dde972d67d6cd
a59f3129123844beb82efeb88f220ad2
acbe310caeeb42c4a53dde972d67d6cd--a59f3129123844beb82efeb88f220ad2
74013d0cc2a348d1bec0bdb7fb7baf43
4437112e506a4fd08f94251bdf9fa8bf
a5180e58bcca4655b866849b13d48512--4437112e506a4fd08f94251bdf9fa8bf
c21d9a9471b44806850f3476078307cf
2
4437112e506a4fd08f94251bdf9fa8bf--906f735409c046bba79547a8d9bcd931
fcc326f367da4d9190be0d1b78b317da
906f735409c046bba79547a8d9bcd931--fcc326f367da4d9190be0d1b78b317da
c3602effe6cc4c43ad6a0612ebe2b02f
H
fcc326f367da4d9190be0d1b78b317da--c3602effe6cc4c43ad6a0612ebe2b02f
e99f6139ae9d40988682e6ac8a67db89
PHASE(1.571)
c3602effe6cc4c43ad6a0612ebe2b02f--e99f6139ae9d40988682e6ac8a67db89
5a9f9d9eab67428b88e5a31dd5e9f09c
PHASE(0.785)
e99f6139ae9d40988682e6ac8a67db89--5a9f9d9eab67428b88e5a31dd5e9f09c
ecbacff8adf14990a33bdbc64752e304
e99f6139ae9d40988682e6ac8a67db89--ecbacff8adf14990a33bdbc64752e304
876b7671402644679541ee305c6561b2
5a9f9d9eab67428b88e5a31dd5e9f09c--876b7671402644679541ee305c6561b2
7144443efef24c759e0cee86239c2d67
5a9f9d9eab67428b88e5a31dd5e9f09c--7144443efef24c759e0cee86239c2d67
bcdf9ed0f7f04184855252992dc6fb68
876b7671402644679541ee305c6561b2--bcdf9ed0f7f04184855252992dc6fb68
2d700c97becb497795c8817185b380de
bcdf9ed0f7f04184855252992dc6fb68--2d700c97becb497795c8817185b380de
2d700c97becb497795c8817185b380de--74013d0cc2a348d1bec0bdb7fb7baf43
0059615d14554f47ab057afa472b3645
ff190cdb12bb4149b7470ce9eb67a739
c21d9a9471b44806850f3476078307cf--ff190cdb12bb4149b7470ce9eb67a739
45c4b914fc8f4cbea4af85ee2618959d
3
1c243a30245c4025ae80e8be6242f633
ff190cdb12bb4149b7470ce9eb67a739--1c243a30245c4025ae80e8be6242f633
1c243a30245c4025ae80e8be6242f633--b3c07f7643c34690b99dc07978e661e4
0b21a10cfbe0457182f7225cdd6d9cda
b3c07f7643c34690b99dc07978e661e4--0b21a10cfbe0457182f7225cdd6d9cda
0b21a10cfbe0457182f7225cdd6d9cda--ecbacff8adf14990a33bdbc64752e304
949841f9a0f94f7d93462e6943b91ee1
ecbacff8adf14990a33bdbc64752e304--949841f9a0f94f7d93462e6943b91ee1
014e1e78a3be4ff68cd1b3ffbbb0c7aa
H
949841f9a0f94f7d93462e6943b91ee1--014e1e78a3be4ff68cd1b3ffbbb0c7aa
df93fb2e08354d8dad53fbc014312328
PHASE(1.571)
014e1e78a3be4ff68cd1b3ffbbb0c7aa--df93fb2e08354d8dad53fbc014312328
32e358d27ee8453d9a8b6156e9fe3fbf
df93fb2e08354d8dad53fbc014312328--32e358d27ee8453d9a8b6156e9fe3fbf
ece1441bedbc42dd8386723ac39b7b70
df93fb2e08354d8dad53fbc014312328--ece1441bedbc42dd8386723ac39b7b70
32e358d27ee8453d9a8b6156e9fe3fbf--0059615d14554f47ab057afa472b3645
cbf5302a5d9842d2a122edb1c0a9fadb
442d840f10b248c6a3b3aca566ffd0b0
45c4b914fc8f4cbea4af85ee2618959d--442d840f10b248c6a3b3aca566ffd0b0
9b719e040ab64ed9afcc451d4b77c0e1
442d840f10b248c6a3b3aca566ffd0b0--9b719e040ab64ed9afcc451d4b77c0e1
a56f29f9e4a04f4ba75d8a87d8e4d4ce
9b719e040ab64ed9afcc451d4b77c0e1--a56f29f9e4a04f4ba75d8a87d8e4d4ce
a56f29f9e4a04f4ba75d8a87d8e4d4ce--e5b03ba7f0a2427fb1f034d0ac19fe1a
c29d2ec2c5764e708e6b9cbe07589a32
e5b03ba7f0a2427fb1f034d0ac19fe1a--c29d2ec2c5764e708e6b9cbe07589a32
1b652dbe638f4cec90c3613bbb8e69bd
c29d2ec2c5764e708e6b9cbe07589a32--1b652dbe638f4cec90c3613bbb8e69bd
1b652dbe638f4cec90c3613bbb8e69bd--7144443efef24c759e0cee86239c2d67
2a4d55c008004a35a24f40cdffed32d2
7144443efef24c759e0cee86239c2d67--2a4d55c008004a35a24f40cdffed32d2
2a4d55c008004a35a24f40cdffed32d2--ece1441bedbc42dd8386723ac39b7b70
eb9ac4922c8d4064a16b12590f1a057c
H
ece1441bedbc42dd8386723ac39b7b70--eb9ac4922c8d4064a16b12590f1a057c
eb9ac4922c8d4064a16b12590f1a057c--cbf5302a5d9842d2a122edb1c0a9fadb
Most importantly, the circuit has a layered structure. The QFT for \(n\) qubits has a total of \(n\) layers, and each layer starts with a Hadamard gate on the first qubit and then builds a ladder of CPHASE
gates. Let's see how we can easily build a function to replicate this circuit.
def qft_layer ( n_qubits , layer_ix ):
qubit_range = range ( layer_ix + 1 , n_qubits )
# CPHASE ladder
cphases = []
for j in qubit_range :
angle = torch . pi / ( 2 ** ( j - layer_ix ))
cphases . append ( CPHASE ( j , layer_ix , angle ))
# Return Hadamard followed by CPHASEs
return qd . chain ( H ( layer_ix ), * cphases )
With the layer function we can easily write the full QFT:
def qft_digital ( n_qubits ):
return qd . chain ( qft_layer ( n_qubits , i ) for i in range ( n_qubits ))
qft_circuit = qft_digital ( 4 )
# display(qft_circuit)
%3
3aa9f6870e9a404d97c39e749ec12460
0
4fda19fa5df34be8bb38cf0de67f559f
H
3aa9f6870e9a404d97c39e749ec12460--4fda19fa5df34be8bb38cf0de67f559f
dcec6721958d4fbe8f8dfb9162e5703d
1
f01895c7c01849a0ad2adf5056ed67c2
PHASE(1.571)
4fda19fa5df34be8bb38cf0de67f559f--f01895c7c01849a0ad2adf5056ed67c2
8c568627e1944ed2897ee80182c10d9f
PHASE(0.785)
f01895c7c01849a0ad2adf5056ed67c2--8c568627e1944ed2897ee80182c10d9f
34e309db7b0c42bf801398c2620d70fb
f01895c7c01849a0ad2adf5056ed67c2--34e309db7b0c42bf801398c2620d70fb
c6214d37ab184842964d064b3f4ed845
PHASE(0.393)
8c568627e1944ed2897ee80182c10d9f--c6214d37ab184842964d064b3f4ed845
1c5562f707e04496bf59c5c16175befb
8c568627e1944ed2897ee80182c10d9f--1c5562f707e04496bf59c5c16175befb
d865b8e28d4647cdbd53e2627ce3bd71
c6214d37ab184842964d064b3f4ed845--d865b8e28d4647cdbd53e2627ce3bd71
066e3758aa0c41498d70904ec1b6ca29
c6214d37ab184842964d064b3f4ed845--066e3758aa0c41498d70904ec1b6ca29
271cd51d092b42d3af71dc6a8dc33397
d865b8e28d4647cdbd53e2627ce3bd71--271cd51d092b42d3af71dc6a8dc33397
f682770993ea4f6b897943104ec0ed90
271cd51d092b42d3af71dc6a8dc33397--f682770993ea4f6b897943104ec0ed90
98677571c9b24e78887c6c739621526d
f682770993ea4f6b897943104ec0ed90--98677571c9b24e78887c6c739621526d
9b70e073ef1c4ac7bab160db5812472f
98677571c9b24e78887c6c739621526d--9b70e073ef1c4ac7bab160db5812472f
f15a09cbf34d4e1095922a81fd5eadad
9b70e073ef1c4ac7bab160db5812472f--f15a09cbf34d4e1095922a81fd5eadad
a6cd07b86ace49cc8fef2f896f6a4cd8
f15a09cbf34d4e1095922a81fd5eadad--a6cd07b86ace49cc8fef2f896f6a4cd8
5f146c0fb5f44cd3b854ba557b1daf03
a2cd86a47ebb4a99925014d5a87722ce
dcec6721958d4fbe8f8dfb9162e5703d--a2cd86a47ebb4a99925014d5a87722ce
3e2b5b162d6f4bdea447853119ca7143
2
a2cd86a47ebb4a99925014d5a87722ce--34e309db7b0c42bf801398c2620d70fb
18216241f4694a37bba2d2c9164ebf0f
34e309db7b0c42bf801398c2620d70fb--18216241f4694a37bba2d2c9164ebf0f
19ce63f1575c4a87bc7b221df4631f58
H
18216241f4694a37bba2d2c9164ebf0f--19ce63f1575c4a87bc7b221df4631f58
05ed1cb6352d4019a7d37c31e4c3a626
PHASE(1.571)
19ce63f1575c4a87bc7b221df4631f58--05ed1cb6352d4019a7d37c31e4c3a626
187209c1fb9043cbab818e4232b8e9e4
PHASE(0.785)
05ed1cb6352d4019a7d37c31e4c3a626--187209c1fb9043cbab818e4232b8e9e4
a0ad516124f04526b938e2aa5d4666e1
05ed1cb6352d4019a7d37c31e4c3a626--a0ad516124f04526b938e2aa5d4666e1
5d809e27b66f4735be12c9eb44609226
187209c1fb9043cbab818e4232b8e9e4--5d809e27b66f4735be12c9eb44609226
b4c6cd9bcf4d462ba1d380bfb6eb6016
187209c1fb9043cbab818e4232b8e9e4--b4c6cd9bcf4d462ba1d380bfb6eb6016
b6d3701c76714705b56d4cb9bfa4c071
5d809e27b66f4735be12c9eb44609226--b6d3701c76714705b56d4cb9bfa4c071
cdcfb034e52f489387b553493743f6a9
b6d3701c76714705b56d4cb9bfa4c071--cdcfb034e52f489387b553493743f6a9
cdcfb034e52f489387b553493743f6a9--5f146c0fb5f44cd3b854ba557b1daf03
c1cce731e13e4891b79b1bea27c7b1b2
97d6351b38874914b7983ba7fea7f046
3e2b5b162d6f4bdea447853119ca7143--97d6351b38874914b7983ba7fea7f046
f75922e784fe4e2e862ab2c25f892334
3
47d8363317b2491895b5e0fd90e7142a
97d6351b38874914b7983ba7fea7f046--47d8363317b2491895b5e0fd90e7142a
47d8363317b2491895b5e0fd90e7142a--1c5562f707e04496bf59c5c16175befb
c3eaf04c7a63469dbd72ed8fa8b96fc3
1c5562f707e04496bf59c5c16175befb--c3eaf04c7a63469dbd72ed8fa8b96fc3
c3eaf04c7a63469dbd72ed8fa8b96fc3--a0ad516124f04526b938e2aa5d4666e1
7388c1fdc4604c9b8ee77e9edd99aa39
a0ad516124f04526b938e2aa5d4666e1--7388c1fdc4604c9b8ee77e9edd99aa39
e31d456fa99f4168aee1ceb8d1a274ef
H
7388c1fdc4604c9b8ee77e9edd99aa39--e31d456fa99f4168aee1ceb8d1a274ef
9cbedc67ed604dbc9a5d6c238c879f99
PHASE(1.571)
e31d456fa99f4168aee1ceb8d1a274ef--9cbedc67ed604dbc9a5d6c238c879f99
6b71bfbe1ae34c4c9d6b689f81771886
9cbedc67ed604dbc9a5d6c238c879f99--6b71bfbe1ae34c4c9d6b689f81771886
c476d2068c00401bac9bdf94ead13c9d
9cbedc67ed604dbc9a5d6c238c879f99--c476d2068c00401bac9bdf94ead13c9d
6b71bfbe1ae34c4c9d6b689f81771886--c1cce731e13e4891b79b1bea27c7b1b2
dd78d161b616403dba349742a98929f0
301c3dbb3472474fa167f51602a4420b
f75922e784fe4e2e862ab2c25f892334--301c3dbb3472474fa167f51602a4420b
52276c270a01404bbf075e964069bfd8
301c3dbb3472474fa167f51602a4420b--52276c270a01404bbf075e964069bfd8
676fd44dff3949449def4151212db95e
52276c270a01404bbf075e964069bfd8--676fd44dff3949449def4151212db95e
676fd44dff3949449def4151212db95e--066e3758aa0c41498d70904ec1b6ca29
2b449bbf200d4f6bb0c731760e522989
066e3758aa0c41498d70904ec1b6ca29--2b449bbf200d4f6bb0c731760e522989
7779bc0a457941a8b631e501d3c8d3f2
2b449bbf200d4f6bb0c731760e522989--7779bc0a457941a8b631e501d3c8d3f2
7779bc0a457941a8b631e501d3c8d3f2--b4c6cd9bcf4d462ba1d380bfb6eb6016
10001324bdb640a989e81fde7041e754
b4c6cd9bcf4d462ba1d380bfb6eb6016--10001324bdb640a989e81fde7041e754
10001324bdb640a989e81fde7041e754--c476d2068c00401bac9bdf94ead13c9d
d20bbf7bc49142cdac873a5358db4419
H
c476d2068c00401bac9bdf94ead13c9d--d20bbf7bc49142cdac873a5358db4419
d20bbf7bc49142cdac873a5358db4419--dd78d161b616403dba349742a98929f0
Decomposing the CPHASE ladder
As we already saw in the previous DAQC tutorial , the CPHASE gate has a well-known decomposition into an Ising Hamiltonian. For the CNOT example, we used the decomposition into \(NN\) interactions. However, here we will use the decomposition into \(ZZ\) interactions to be consistent with the description in the original DA-QFT paper . The decomposition is the following:
\[\text{CPHASE}(i,j,\phi)=\text{exp}\left(-i\phi H_\text{CP}(i, j)\right)\]
\[\begin{aligned}
H_\text{CP}&=-\frac{1}{4}(I_i-Z_i)(I_j-Z_j)\\
&=-\frac{1}{4}(I_iI_j-Z_i-Z_j)-\frac{1}{4}Z_iZ_j
\end{aligned}\]
where the terms in \((I_iI_j-Z_i-Z_j)\) represents single-qubit rotations, while the interaction is given by the Ising term \(Z_iZ_j\) .
Just as we did for the CNOT, to build the DA-QFT we need to write the CPHASE ladder as an Ising Hamiltonian. To do so, we again write the Hamiltonian consisting of the single-qubit rotations from all CPHASEs in the layer, as well as the Hamiltonian for the two-qubit Ising interactions so that we can then use the DAQC transformation. The full mathematical details for this are written in the paper , and below we write the necessary code for it, using the same notation as in the paper, including indices running from 1 to N.
# The angle of the CPHASE used in the single-qubit rotations:
def theta ( k ):
"""Eq. (16) from [^2]."""
return torch . pi / ( 2 ** ( k + 1 ))
# The angle of the CPHASE used in the two-qubit interactions:
def alpha ( c , k , m ):
"""Eq. (16) from [^2]."""
return torch . pi / ( 2 ** ( k - m + 2 )) if c == m else 0.0
The first two functions represent the angles of the various CPHASE
gates that will be used to build the qubit Hamiltonians representing each QFT layer. In the alpha
function we include an implicit kronecker delta between the indices m
and c
, following the conventions and equations written in the paper . This is simply because when building the Hamiltonian the paper sums through all possible \(n(n-1)\) interacting pairs, but only the pairs that are connected by a CPHASE
in each QFT layer should have a non-zero interaction.
# Building the generator for the single-qubit rotations
def build_sqg_gen ( n_qubits , m ):
"""Generator in Eq. (13) from [^2] without the Hadamard."""
k_sqg_range = range ( 2 , n_qubits - m + 2 )
sqg_gen_list = []
for k in k_sqg_range :
sqg_gen = qd . kron ( I ( j ) for j in range ( n_qubits )) - Z ( k + m - 2 ) - Z ( m - 1 )
sqg_gen_list . append ( theta ( k ) * sqg_gen )
return sqg_gen_list
# Building the generator for the two-qubit interactions
def build_tqg_gen ( n_qubits , m ):
"""Generator in Eq. (14) from [^2]."""
k_tqg_range = range ( 2 , n_qubits + 1 )
tqg_gen_list = []
for k in k_tqg_range :
for c in range ( 1 , k ):
tqg_gen = qd . kron ( Z ( c - 1 ), Z ( k - 1 ))
tqg_gen_list . append ( alpha ( c , k , m ) * tqg_gen )
return tqg_gen_list
There's a lot to process in the above functions, and it might be worth taking some time to go through them with the help of the description in .
Let's convince ourselves that they are doing what they are supposed to: perform one layer of the QFT using a decomposition of the CPHASE gates into an Ising Hamiltonian. We start by defining the function that will produce a given QFT layer:
def qft_layer_decomposed ( n_qubits , layer_ix ):
m = layer_ix + 1 # Paper index convention
# Step 1:
# List of generator terms for the single-qubit rotations
sqg_gen_list = build_sqg_gen ( n_qubits , m )
# Exponentiate the generator for single-qubit rotations:
sq_rotations = HamEvo ( qd . add ( * sqg_gen_list ), - 1.0 )
# Step 2:
# List of generator for the two-qubit interactions
ising_gen_list = build_tqg_gen ( n_qubits , m )
# Exponentiating the Ising interactions:
ising_cphase = HamEvo ( qd . add ( * ising_gen_list ), - 1.0 )
# Add the explicit Hadamard to start followed by the Hamiltonian evolutions
if len ( sqg_gen_list ) > 0 :
return qd . chain ( H ( layer_ix ), sq_rotations , ising_cphase )
else :
# If the generator lists are empty returns just the Hadamard of the final layer
return H ( layer_ix )
And now we build a layer of the QFT for both the digital and the decomposed case and check that they match:
n_qubits = 3
layer_ix = 0
# Building the layer with the digital QFT:
digital_layer_block = qft_layer ( n_qubits , layer_ix )
# Building the layer with the Ising decomposition:
decomposed_layer_block = qft_layer_decomposed ( n_qubits , layer_ix )
# Check that we get the same block in matrix form:
block_digital_matrix = qd . block_to_tensor ( digital_layer_block )
block_decomposed_matrix = qd . block_to_tensor ( decomposed_layer_block )
assert torch . allclose ( block_digital_matrix , block_decomposed_matrix )
We now have all the ingredients to build the Digital-Analog QFT:
In the previous DAQC tutorial we have learned about transforming an arbitrary Ising Hamiltonian into a program executing only a fixed, system-specific one.
In this tutorial we have so far learned how to "extract" the arbitrary Ising Hamiltonian being used in each QFT layer.
All that is left for us to do is to specify our system Hamiltonian, apply the DAQC transform, and build the Digital-Analog QFT layer function.
For simplicity, we will once again consider an all-to-all Ising Hamiltonian with a constant interaction strength, but this step generalizes so any other Hamiltonian (given the limitations already discussed in the previous DAQC tutorial ).
def h_sys ( n_qubits , g_int = 1.0 ):
interaction_list = []
for i in range ( n_qubits ):
for j in range ( i ):
interaction_list . append ( g_int * qd . kron ( Z ( i ), Z ( j )))
return qd . add ( * interaction_list )
Now, all we have to do is re-write the qft layer function but replace Step 2. with the transformed evolution:
def qft_layer_DAQC ( n_qubits , layer_ix ):
m = layer_ix + 1 # Paper index convention
# Step 1:
# List of generator terms for the single-qubit rotations
sqg_gen_list = build_sqg_gen ( n_qubits , m )
# Exponentiate the generator for single-qubit rotations:
sq_rotations = HamEvo ( qd . add ( * sqg_gen_list ), - 1.0 )
# Step 2:
# List of generator for the two-qubit interactions
ising_gen_list = build_tqg_gen ( n_qubits , m )
# Transforming the target generator with DAQC:
gen_target = qd . add ( * ising_gen_list )
transformed_ising = qd . daqc_transform (
n_qubits = n_qubits , # Total number of qubits in the transformation
gen_target = gen_target , # The target Ising generator
t_f = - 1.0 , # The target evolution time
gen_build = h_sys ( n_qubits ), # The building block Ising generator to be used
)
# Add the explicit Hadamard to start followed by the Hamiltonian evolutions
if len ( sqg_gen_list ) > 0 :
return qd . chain ( H ( layer_ix ), sq_rotations , transformed_ising )
else :
# If the generator lists are empty returns just the Hadamard of the final layer
return H ( layer_ix )
And finally, to convince ourselves that the results are correct, let's build the full DA-QFT and compare it with the digital version:
def qft_digital_analog ( n_qubits ):
return qd . chain ( qft_layer_DAQC ( n_qubits , i ) for i in range ( n_qubits ))
n_qubits = 3
digital_qft_block = qft_digital ( n_qubits )
daqc_qft_block = qft_digital_analog ( n_qubits )
# Check that we get the same block in matrix form:
block_digital_matrix = qd . block_to_tensor ( digital_qft_block )
block_daqc_matrix = qd . block_to_tensor ( daqc_qft_block )
assert torch . allclose ( block_digital_matrix , block_daqc_matrix )
And we can now display the program for the DA-QFT:
# display(daqc_qft_block)
%3
cluster_88ad48ff669c4886b2ea710acc90bc4a
cluster_4572eec9ec284ba0973c31e72a9f922e
cluster_94c9deb64b1343cda9d9ef54f6da0686
cluster_ffa3b30d05544a3a9e37a748f679c1b7
cluster_882e712216534f32be15be440fc4f82a
cluster_15778dff1c31402c8526020243cdd6a6
cluster_4ee0671fdc6449418c2b61c52afca6a4
6ac766fff1d249b0876fcc614c5fdcfe
0
ca950c317cc24b88a7079b0fc5c973de
H
6ac766fff1d249b0876fcc614c5fdcfe--ca950c317cc24b88a7079b0fc5c973de
c949b915c4274454b540689c9497c7e2
1
abd0dd4e4b79428b9aefa0e653e974ed
HamEvo
ca950c317cc24b88a7079b0fc5c973de--abd0dd4e4b79428b9aefa0e653e974ed
af0c5259cfd64133a054cf0ef5f4a317
X
abd0dd4e4b79428b9aefa0e653e974ed--af0c5259cfd64133a054cf0ef5f4a317
035e61c5865b4f76888ce3c3a9b3b383
HamEvo
af0c5259cfd64133a054cf0ef5f4a317--035e61c5865b4f76888ce3c3a9b3b383
ca0ee33762c8453b966f8924ef346c2e
X
035e61c5865b4f76888ce3c3a9b3b383--ca0ee33762c8453b966f8924ef346c2e
bb2098b28da0478f9bb24ddfbf89e48e
X
ca0ee33762c8453b966f8924ef346c2e--bb2098b28da0478f9bb24ddfbf89e48e
02dc6d03461b4ecd9c6b753919c121cb
HamEvo
bb2098b28da0478f9bb24ddfbf89e48e--02dc6d03461b4ecd9c6b753919c121cb
42a052f4003a4a2d9132612f34fa7db1
X
02dc6d03461b4ecd9c6b753919c121cb--42a052f4003a4a2d9132612f34fa7db1
87937e10f7a4424db12d57c8967d9b7e
42a052f4003a4a2d9132612f34fa7db1--87937e10f7a4424db12d57c8967d9b7e
c9d59c3092ac45a2b2f2daa9126d47dc
HamEvo
87937e10f7a4424db12d57c8967d9b7e--c9d59c3092ac45a2b2f2daa9126d47dc
78933b79c97946acb462d6161719ea9b
c9d59c3092ac45a2b2f2daa9126d47dc--78933b79c97946acb462d6161719ea9b
ecdc2f2ff3d44fb2aa553a0245ca7b79
78933b79c97946acb462d6161719ea9b--ecdc2f2ff3d44fb2aa553a0245ca7b79
ff53819e31db46a095bc939f540cc407
HamEvo
ecdc2f2ff3d44fb2aa553a0245ca7b79--ff53819e31db46a095bc939f540cc407
2d1050d694984c78aa09daecb82c795a
X
ff53819e31db46a095bc939f540cc407--2d1050d694984c78aa09daecb82c795a
7253fd15f5f349969b195f0a80de2cf4
HamEvo
2d1050d694984c78aa09daecb82c795a--7253fd15f5f349969b195f0a80de2cf4
b1646db977424b6e8da1443fa7b124eb
X
7253fd15f5f349969b195f0a80de2cf4--b1646db977424b6e8da1443fa7b124eb
c72192f465294b1b8f1bafaf75b1b793
X
b1646db977424b6e8da1443fa7b124eb--c72192f465294b1b8f1bafaf75b1b793
6d65344147bc4bdfac01c01ba6dacf1c
HamEvo
c72192f465294b1b8f1bafaf75b1b793--6d65344147bc4bdfac01c01ba6dacf1c
2e60c6d35d774c1fb71eb9d1451442e6
X
6d65344147bc4bdfac01c01ba6dacf1c--2e60c6d35d774c1fb71eb9d1451442e6
5f7d9d7dc08c4a7aa2cdda3b32f50cfe
2e60c6d35d774c1fb71eb9d1451442e6--5f7d9d7dc08c4a7aa2cdda3b32f50cfe
6a3077fd1169403f80de154eeace21d3
5f7d9d7dc08c4a7aa2cdda3b32f50cfe--6a3077fd1169403f80de154eeace21d3
16ec459bf83f4d1e963318a7234f7f59
79e6d1a4395b4adb9ee14a3a88a8f61a
c949b915c4274454b540689c9497c7e2--79e6d1a4395b4adb9ee14a3a88a8f61a
a91656fa8e6642fd900c4d0b8f2e148e
2
7fe34ac751e6436882aabeb00a68f476
t = -1.00000000000000
79e6d1a4395b4adb9ee14a3a88a8f61a--7fe34ac751e6436882aabeb00a68f476
a9e391866b724268bb74bc41e9beea80
X
7fe34ac751e6436882aabeb00a68f476--a9e391866b724268bb74bc41e9beea80
774a7eccfd874043b3dc4c53a4727275
t = 0.098
a9e391866b724268bb74bc41e9beea80--774a7eccfd874043b3dc4c53a4727275
c5e2e3551373413e97924cc1c7b92e46
X
774a7eccfd874043b3dc4c53a4727275--c5e2e3551373413e97924cc1c7b92e46
999f6d7b7e8243889e1677cd4886e3ef
c5e2e3551373413e97924cc1c7b92e46--999f6d7b7e8243889e1677cd4886e3ef
197860c871af47acbfd4c434d1dd2545
t = 0.196
999f6d7b7e8243889e1677cd4886e3ef--197860c871af47acbfd4c434d1dd2545
cc50bafde9744da792463ff44d6b2575
197860c871af47acbfd4c434d1dd2545--cc50bafde9744da792463ff44d6b2575
79b8ec4ddff045b4be73760ba56ad4a3
X
cc50bafde9744da792463ff44d6b2575--79b8ec4ddff045b4be73760ba56ad4a3
247bc30b81a24065b69cf68793d240f4
t = 0.295
79b8ec4ddff045b4be73760ba56ad4a3--247bc30b81a24065b69cf68793d240f4
3075deb17f6b4fecb490ea0009d7fbd4
X
247bc30b81a24065b69cf68793d240f4--3075deb17f6b4fecb490ea0009d7fbd4
3e1775903d7c49aa8ef0529bcaf90382
H
3075deb17f6b4fecb490ea0009d7fbd4--3e1775903d7c49aa8ef0529bcaf90382
e8d2439aa0ad4abcb5a9decc3dd4aa64
t = -1.00000000000000
3e1775903d7c49aa8ef0529bcaf90382--e8d2439aa0ad4abcb5a9decc3dd4aa64
ce1506a89e124bedb7461f9d4edba87f
X
e8d2439aa0ad4abcb5a9decc3dd4aa64--ce1506a89e124bedb7461f9d4edba87f
e2286192a30d4d07a9b5804098b9f6d2
t = 0.196
ce1506a89e124bedb7461f9d4edba87f--e2286192a30d4d07a9b5804098b9f6d2
e541cd2ddd964dcc93bfaf356f4841c3
X
e2286192a30d4d07a9b5804098b9f6d2--e541cd2ddd964dcc93bfaf356f4841c3
7b71519489b342ca925a3d477d6e983e
e541cd2ddd964dcc93bfaf356f4841c3--7b71519489b342ca925a3d477d6e983e
ddc3ada16a1e416a9ce254ad51e4ea55
t = 0.196
7b71519489b342ca925a3d477d6e983e--ddc3ada16a1e416a9ce254ad51e4ea55
ee117f6f2c4a47e79ce1f4b7fa09eb96
ddc3ada16a1e416a9ce254ad51e4ea55--ee117f6f2c4a47e79ce1f4b7fa09eb96
8fde0bc3f2c74910bf9f40c406485df3
ee117f6f2c4a47e79ce1f4b7fa09eb96--8fde0bc3f2c74910bf9f40c406485df3
8fde0bc3f2c74910bf9f40c406485df3--16ec459bf83f4d1e963318a7234f7f59
a000aa85310b4d2298bd3c6aea05c22b
bc22d3b06e3e45ee81dcee2b6b09f763
a91656fa8e6642fd900c4d0b8f2e148e--bc22d3b06e3e45ee81dcee2b6b09f763
da5791d0ddba49c28c1155f744bb2acd
bc22d3b06e3e45ee81dcee2b6b09f763--da5791d0ddba49c28c1155f744bb2acd
65f02225aab145d991daa1765082664d
da5791d0ddba49c28c1155f744bb2acd--65f02225aab145d991daa1765082664d
e7f395e756024970b7eac9e507fdfb19
65f02225aab145d991daa1765082664d--e7f395e756024970b7eac9e507fdfb19
d0ac085de45949bb820ed75d3412f1af
e7f395e756024970b7eac9e507fdfb19--d0ac085de45949bb820ed75d3412f1af
d6070e28306e49ddb1324503da837c7d
X
d0ac085de45949bb820ed75d3412f1af--d6070e28306e49ddb1324503da837c7d
8ea4d09a98894a36aab87937f631e185
d6070e28306e49ddb1324503da837c7d--8ea4d09a98894a36aab87937f631e185
df8ad2d506224edd9f442129bb615cca
X
8ea4d09a98894a36aab87937f631e185--df8ad2d506224edd9f442129bb615cca
7c4e4c1d43ef4258a9b9501aeff426df
X
df8ad2d506224edd9f442129bb615cca--7c4e4c1d43ef4258a9b9501aeff426df
8f996966bebd42c9afff4228289316f0
7c4e4c1d43ef4258a9b9501aeff426df--8f996966bebd42c9afff4228289316f0
a948404985d44a0a802e6d03f6b96ab7
X
8f996966bebd42c9afff4228289316f0--a948404985d44a0a802e6d03f6b96ab7
2a6db7d1559741d797699e299aa18b1d
a948404985d44a0a802e6d03f6b96ab7--2a6db7d1559741d797699e299aa18b1d
2406538a74d5457388254831dc2b469a
2a6db7d1559741d797699e299aa18b1d--2406538a74d5457388254831dc2b469a
a8b8176337294b7f9effe354a03412cf
2406538a74d5457388254831dc2b469a--a8b8176337294b7f9effe354a03412cf
cacbe8864f7640ccaf1e7678dda32d27
a8b8176337294b7f9effe354a03412cf--cacbe8864f7640ccaf1e7678dda32d27
af2c6c9dd3b54431a5e4eaf47126b271
cacbe8864f7640ccaf1e7678dda32d27--af2c6c9dd3b54431a5e4eaf47126b271
5b56b09076544ef6ae3f9e2b177108b4
X
af2c6c9dd3b54431a5e4eaf47126b271--5b56b09076544ef6ae3f9e2b177108b4
9865bfe12fa044e0b1d00ae2625bfd99
5b56b09076544ef6ae3f9e2b177108b4--9865bfe12fa044e0b1d00ae2625bfd99
0fd056f5cc704dc2bc500ff25cf404c3
X
9865bfe12fa044e0b1d00ae2625bfd99--0fd056f5cc704dc2bc500ff25cf404c3
b4a12b8124324f17bba718018efd6106
H
0fd056f5cc704dc2bc500ff25cf404c3--b4a12b8124324f17bba718018efd6106
b4a12b8124324f17bba718018efd6106--a000aa85310b4d2298bd3c6aea05c22b
The DA-QFT in qadence
:
The digital-analog QFT is available directly by using the strategy
argument in the QFT:
n_qubits = 3
qft_circuit = qd . qft ( n_qubits , strategy = qd . Strategy . SDAQC )
# display(qft_circuit)
%3
cluster_8b49710b0d2c43548128cf1b67d7c281
cluster_9fcfba59ab424719a330ac406ecf0177
cluster_785379db17424179a36b5d30a97e6891
cluster_903b715fb49d4855ba6cb43421a16019
cluster_445a6999617344c294993c9fb82488b3
cluster_2724d66a8f00486f85a8a9ff6bc0686a
cluster_e1f70dd11f564cfc9847dc102946ed87
cluster_d02805f284414f1bb74cea5d0b83db73
cluster_1b955ad41d994be1bd8e5a770dd9afc8
cluster_d9998620bb2946b09cbeb83aca725462
cluster_b65878d1836d4d189566e956a489898d
cluster_e6048803165b4c5a9894369fe839c76d
cluster_5186a800b092438ab4c40f9a986d8c70
cluster_0ffef0f703a449b8a8caf4383f61ef1e
5c5a6878714f472eb18a9988d5ba79ca
0
20f5cefe24c549419407b4accab74c8c
H
5c5a6878714f472eb18a9988d5ba79ca--20f5cefe24c549419407b4accab74c8c
70e1eed30ead4292892c263371e93ec8
1
b45b1a4a386b4eba928010e76018568a
HamEvo
20f5cefe24c549419407b4accab74c8c--b45b1a4a386b4eba928010e76018568a
af4d208bb57e4e67876b15f3faddcf8e
HamEvo
b45b1a4a386b4eba928010e76018568a--af4d208bb57e4e67876b15f3faddcf8e
29821b6cd0754e0dbfdd1f930d49e472
X
af4d208bb57e4e67876b15f3faddcf8e--29821b6cd0754e0dbfdd1f930d49e472
9c21aaac81444f69893718ac678ddd54
HamEvo
29821b6cd0754e0dbfdd1f930d49e472--9c21aaac81444f69893718ac678ddd54
62aedeaf1c2b4bb0a1e5307aaf25dfb4
HamEvo
9c21aaac81444f69893718ac678ddd54--62aedeaf1c2b4bb0a1e5307aaf25dfb4
743835ee4e2f4da6881a3f2666f9d00b
X
62aedeaf1c2b4bb0a1e5307aaf25dfb4--743835ee4e2f4da6881a3f2666f9d00b
858983c05ddb4067840537937607e73f
X
743835ee4e2f4da6881a3f2666f9d00b--858983c05ddb4067840537937607e73f
04573f6adde440eda316b0c651f1a15f
HamEvo
858983c05ddb4067840537937607e73f--04573f6adde440eda316b0c651f1a15f
9c26d9b5569d432aafb2836c6296e2ca
HamEvo
04573f6adde440eda316b0c651f1a15f--9c26d9b5569d432aafb2836c6296e2ca
b263c1fbdd674399b207950ba18c0616
X
9c26d9b5569d432aafb2836c6296e2ca--b263c1fbdd674399b207950ba18c0616
0db067a7700947638b1a0d24832d0f3d
b263c1fbdd674399b207950ba18c0616--0db067a7700947638b1a0d24832d0f3d
c5dd0f54642344b88e74bd3fac30f1d1
HamEvo
0db067a7700947638b1a0d24832d0f3d--c5dd0f54642344b88e74bd3fac30f1d1
778d0d7e9fbb477484e8cf2cc057d375
HamEvo
c5dd0f54642344b88e74bd3fac30f1d1--778d0d7e9fbb477484e8cf2cc057d375
c06267bc85704d2e8c3b52ceb801bd33
778d0d7e9fbb477484e8cf2cc057d375--c06267bc85704d2e8c3b52ceb801bd33
68af10ce5e374cf59be228f888f1f43e
c06267bc85704d2e8c3b52ceb801bd33--68af10ce5e374cf59be228f888f1f43e
c47e829ec90a43dba8ed1a8cb3c63f1d
HamEvo
68af10ce5e374cf59be228f888f1f43e--c47e829ec90a43dba8ed1a8cb3c63f1d
b9894620405e424bb45e2faf5770aa8c
HamEvo
c47e829ec90a43dba8ed1a8cb3c63f1d--b9894620405e424bb45e2faf5770aa8c
4b106f9eccdb4aa89156b7f3b133af40
X
b9894620405e424bb45e2faf5770aa8c--4b106f9eccdb4aa89156b7f3b133af40
17b785e1fd304726b0a78c6ff11d7282
HamEvo
4b106f9eccdb4aa89156b7f3b133af40--17b785e1fd304726b0a78c6ff11d7282
6def16d9fcdf47cfb2052193b19b7600
HamEvo
17b785e1fd304726b0a78c6ff11d7282--6def16d9fcdf47cfb2052193b19b7600
b453c011029241488d10313eaa8a4492
X
6def16d9fcdf47cfb2052193b19b7600--b453c011029241488d10313eaa8a4492
d07e5094a4fb4ae99b0088d51b035f8d
X
b453c011029241488d10313eaa8a4492--d07e5094a4fb4ae99b0088d51b035f8d
a236253531424cfa9bd6aff3fd1087f4
HamEvo
d07e5094a4fb4ae99b0088d51b035f8d--a236253531424cfa9bd6aff3fd1087f4
184522afc13c466eaea34bbaf553d19a
HamEvo
a236253531424cfa9bd6aff3fd1087f4--184522afc13c466eaea34bbaf553d19a
ddcfeb6613274f26a8919cb0c27de762
X
184522afc13c466eaea34bbaf553d19a--ddcfeb6613274f26a8919cb0c27de762
c75153e3010249d7819456523874b98b
ddcfeb6613274f26a8919cb0c27de762--c75153e3010249d7819456523874b98b
155a58535e4541b4a0ad3896ad73b607
c75153e3010249d7819456523874b98b--155a58535e4541b4a0ad3896ad73b607
b5e174de78df41459fb852fc0856ea56
009fe434e739499d99a6e0561dfb6d97
70e1eed30ead4292892c263371e93ec8--009fe434e739499d99a6e0561dfb6d97
60730e609c324c8d876adcad43b358a0
2
8dce0caeee8944878f5750f17e186ed2
t = -1.00000000000000
009fe434e739499d99a6e0561dfb6d97--8dce0caeee8944878f5750f17e186ed2
a0f363978e3e4e96ad613302ba8756db
t = 2.356
8dce0caeee8944878f5750f17e186ed2--a0f363978e3e4e96ad613302ba8756db
c628e33f85ce4aedb98098bd4c676010
X
a0f363978e3e4e96ad613302ba8756db--c628e33f85ce4aedb98098bd4c676010
21b5acc100874458a27762fd6662daee
t = 0.393
c628e33f85ce4aedb98098bd4c676010--21b5acc100874458a27762fd6662daee
958c6869e85d4063bfda93b3b46bee0e
t = 0.393
21b5acc100874458a27762fd6662daee--958c6869e85d4063bfda93b3b46bee0e
8d4850aa16b84e6681431e251f7bd1d1
X
958c6869e85d4063bfda93b3b46bee0e--8d4850aa16b84e6681431e251f7bd1d1
fd1fe0eb83ea4c20889da66816335e32
8d4850aa16b84e6681431e251f7bd1d1--fd1fe0eb83ea4c20889da66816335e32
2d9114125f274f829e05603a52e3a1ef
t = 0.785
fd1fe0eb83ea4c20889da66816335e32--2d9114125f274f829e05603a52e3a1ef
7fc82f4914294065b2c6c3742f6adc05
t = 0.785
2d9114125f274f829e05603a52e3a1ef--7fc82f4914294065b2c6c3742f6adc05
ab30d5604344475dbadcf381b80f7c8e
7fc82f4914294065b2c6c3742f6adc05--ab30d5604344475dbadcf381b80f7c8e
1b8f3e08c6284cf0bf1b3a8dac7efbb1
X
ab30d5604344475dbadcf381b80f7c8e--1b8f3e08c6284cf0bf1b3a8dac7efbb1
a46e5a5e97ae4a199ab9abae1131eb2e
t = 1.178
1b8f3e08c6284cf0bf1b3a8dac7efbb1--a46e5a5e97ae4a199ab9abae1131eb2e
3259b970968042be94ff7589e44e8d8a
t = 1.178
a46e5a5e97ae4a199ab9abae1131eb2e--3259b970968042be94ff7589e44e8d8a
71d8a68419444a09958b36d939dd6a76
X
3259b970968042be94ff7589e44e8d8a--71d8a68419444a09958b36d939dd6a76
90ea0206fae9409e92ffbea5240460c9
H
71d8a68419444a09958b36d939dd6a76--90ea0206fae9409e92ffbea5240460c9
c5ee28a4860a488b8520ce671af2bd2a
t = -1.00000000000000
90ea0206fae9409e92ffbea5240460c9--c5ee28a4860a488b8520ce671af2bd2a
8285d98ac5124d74b8110e856e93a503
t = 1.571
c5ee28a4860a488b8520ce671af2bd2a--8285d98ac5124d74b8110e856e93a503
8fc290858afd40c3b409641b4647f2f8
X
8285d98ac5124d74b8110e856e93a503--8fc290858afd40c3b409641b4647f2f8
6c3ec2c9e6194c6ba66cf9470f962d98
t = 0.785
8fc290858afd40c3b409641b4647f2f8--6c3ec2c9e6194c6ba66cf9470f962d98
42e634069d214c19a8ab5286da0ddb95
t = 0.785
6c3ec2c9e6194c6ba66cf9470f962d98--42e634069d214c19a8ab5286da0ddb95
a1b5d3e99e9a4bc9ad154d6de11305d6
X
42e634069d214c19a8ab5286da0ddb95--a1b5d3e99e9a4bc9ad154d6de11305d6
43e085d05a0d4695ae78bc4e6f6a471c
a1b5d3e99e9a4bc9ad154d6de11305d6--43e085d05a0d4695ae78bc4e6f6a471c
09ad4d75958d4b0e8d2f7baefe1c949a
t = 0.785
43e085d05a0d4695ae78bc4e6f6a471c--09ad4d75958d4b0e8d2f7baefe1c949a
a6e516e0a938458fb4e2d38a1b0a0c17
t = 0.785
09ad4d75958d4b0e8d2f7baefe1c949a--a6e516e0a938458fb4e2d38a1b0a0c17
7aa083525e9648d1a107bc10f943c204
a6e516e0a938458fb4e2d38a1b0a0c17--7aa083525e9648d1a107bc10f943c204
b1766cc2932748e186c8b9af5c0d1816
7aa083525e9648d1a107bc10f943c204--b1766cc2932748e186c8b9af5c0d1816
b1766cc2932748e186c8b9af5c0d1816--b5e174de78df41459fb852fc0856ea56
01a6144344d84f7192d3b1483d1818ff
39aa841e719e4858babe31c6a28c5bd9
60730e609c324c8d876adcad43b358a0--39aa841e719e4858babe31c6a28c5bd9
2431547bb86d4e45b05fd07fa057f945
39aa841e719e4858babe31c6a28c5bd9--2431547bb86d4e45b05fd07fa057f945
13e9c11bd2b346218a7bb0c275942f3f
2431547bb86d4e45b05fd07fa057f945--13e9c11bd2b346218a7bb0c275942f3f
2c7abbfb6d7d402b85a4d84738fe2df5
13e9c11bd2b346218a7bb0c275942f3f--2c7abbfb6d7d402b85a4d84738fe2df5
b3d02705e26e4881b975eaee13395488
2c7abbfb6d7d402b85a4d84738fe2df5--b3d02705e26e4881b975eaee13395488
9be9167948d84ac8b8ba95c33a6b582e
b3d02705e26e4881b975eaee13395488--9be9167948d84ac8b8ba95c33a6b582e
b4479cc5cd2e4db7a0a65a93d49a59f0
9be9167948d84ac8b8ba95c33a6b582e--b4479cc5cd2e4db7a0a65a93d49a59f0
960f791425d64346aa1f819561f7b2ab
X
b4479cc5cd2e4db7a0a65a93d49a59f0--960f791425d64346aa1f819561f7b2ab
17244727ecc54a0b95bf69ebc58cdbb5
960f791425d64346aa1f819561f7b2ab--17244727ecc54a0b95bf69ebc58cdbb5
d795a7246a5944efa9a637e435c8f33f
17244727ecc54a0b95bf69ebc58cdbb5--d795a7246a5944efa9a637e435c8f33f
bf048219a38d48ff8fd47169b3ae5169
X
d795a7246a5944efa9a637e435c8f33f--bf048219a38d48ff8fd47169b3ae5169
df1b2917bc944578b11b464dba70d178
X
bf048219a38d48ff8fd47169b3ae5169--df1b2917bc944578b11b464dba70d178
4b74693bbeec470fbe0cf8611e04845f
df1b2917bc944578b11b464dba70d178--4b74693bbeec470fbe0cf8611e04845f
ce2f531e6dd5405eae9f8c1e973afa99
4b74693bbeec470fbe0cf8611e04845f--ce2f531e6dd5405eae9f8c1e973afa99
3cc71fe21abb4cf58acdcf8197520fcf
X
ce2f531e6dd5405eae9f8c1e973afa99--3cc71fe21abb4cf58acdcf8197520fcf
c0b1d53beae347a58687e168c7caa2ad
3cc71fe21abb4cf58acdcf8197520fcf--c0b1d53beae347a58687e168c7caa2ad
45a68bbf00f74dd08f0ebcb23d6ba4fa
c0b1d53beae347a58687e168c7caa2ad--45a68bbf00f74dd08f0ebcb23d6ba4fa
6d3124bde43e49b1bc5a32f8cc48ce43
45a68bbf00f74dd08f0ebcb23d6ba4fa--6d3124bde43e49b1bc5a32f8cc48ce43
0134fa2eb63644ccb86da95d83a003e0
6d3124bde43e49b1bc5a32f8cc48ce43--0134fa2eb63644ccb86da95d83a003e0
c6cbe47980b143deb694c8e0032532fa
0134fa2eb63644ccb86da95d83a003e0--c6cbe47980b143deb694c8e0032532fa
4ae14b0c679748f898d755de6aeda191
c6cbe47980b143deb694c8e0032532fa--4ae14b0c679748f898d755de6aeda191
116f7436f8f24ca7985e42a2009d4afd
4ae14b0c679748f898d755de6aeda191--116f7436f8f24ca7985e42a2009d4afd
2dbdb76ee961428d8a710a2411b3921e
X
116f7436f8f24ca7985e42a2009d4afd--2dbdb76ee961428d8a710a2411b3921e
f8a79dc445424df8a9f3212b667976d8
2dbdb76ee961428d8a710a2411b3921e--f8a79dc445424df8a9f3212b667976d8
434430be05bb4be285ddc1f10c2ece78
f8a79dc445424df8a9f3212b667976d8--434430be05bb4be285ddc1f10c2ece78
5ef1214d8bb842678928d24487605f57
X
434430be05bb4be285ddc1f10c2ece78--5ef1214d8bb842678928d24487605f57
8a4190da1c334c948ad73fb9724a5574
H
5ef1214d8bb842678928d24487605f57--8a4190da1c334c948ad73fb9724a5574
8a4190da1c334c948ad73fb9724a5574--01a6144344d84f7192d3b1483d1818ff
Just like with the daqc_transform
, we can pass a different build Hamiltonian to it for the analog blocks, including one composed of \(NN\) interactions:
from qadence import hamiltonian_factory , Interaction
n_qubits = 3
gen_build = hamiltonian_factory ( n_qubits , interaction = Interaction . NN )
qft_circuit = qd . qft ( n_qubits , strategy = qd . Strategy . SDAQC , gen_build = gen_build )
# display(qft_circuit)
%3
cluster_3ea27f6079ec4aa4b9574e826fba0cee
cluster_8b6d38435e704bd1b69693ba6e7d99e9
cluster_b4ec6f3385aa4c129371f19dd66b427e
cluster_787359dd3a07452fa01276e38011ac47
cluster_72ca46c7c46346e0b0335c00544368fe
cluster_fec6a799f0504128998fb13f28ca3929
cluster_40fa0c04b59541e69da718bcb002e513
cluster_e10541e8235f49f6a25f783339c8a28c
cluster_35a2816e2b2e43ab805fe3d780c93f6b
cluster_48d092fa456f4536a145232d839dcf21
cluster_3ac7908ca9b443679752e6cf5b8f1078
cluster_d1687cf89e13496c9cc2601dc61b4b33
cluster_fd46bfaad199443e860f0317fac0014a
cluster_454f19ae724d43bca155681c7d969b6e
e3a7f78eeab04af9ab8cb78ff8b769be
0
44995e1ef76d40e4acd060356b53699a
H
e3a7f78eeab04af9ab8cb78ff8b769be--44995e1ef76d40e4acd060356b53699a
4faf06d09c4445c5855a7fcbd7009c9b
1
74dfc1b0575d4e439d8b496cc73c5707
HamEvo
44995e1ef76d40e4acd060356b53699a--74dfc1b0575d4e439d8b496cc73c5707
2812da5cf02a45caa1b3d47bdea2b1fa
HamEvo
74dfc1b0575d4e439d8b496cc73c5707--2812da5cf02a45caa1b3d47bdea2b1fa
7a6b0d0a2196400c9cd62fbd3e79dbcc
X
2812da5cf02a45caa1b3d47bdea2b1fa--7a6b0d0a2196400c9cd62fbd3e79dbcc
f701b16fd9a24c64aaa97337f4e2528b
HamEvo
7a6b0d0a2196400c9cd62fbd3e79dbcc--f701b16fd9a24c64aaa97337f4e2528b
90cb3506f44848999534230cee68d3e2
HamEvo
f701b16fd9a24c64aaa97337f4e2528b--90cb3506f44848999534230cee68d3e2
ce0f23edb2fb4ece87f4ba49e52b171b
X
90cb3506f44848999534230cee68d3e2--ce0f23edb2fb4ece87f4ba49e52b171b
145b29ae368f41e69eef68fcdb33e45b
X
ce0f23edb2fb4ece87f4ba49e52b171b--145b29ae368f41e69eef68fcdb33e45b
aaf6ba8b504247d786155924cb11002f
HamEvo
145b29ae368f41e69eef68fcdb33e45b--aaf6ba8b504247d786155924cb11002f
f72ebee9157a498c9b61c30ae9179e3a
HamEvo
aaf6ba8b504247d786155924cb11002f--f72ebee9157a498c9b61c30ae9179e3a
368e1404efa648619d3e13689ad87c9f
X
f72ebee9157a498c9b61c30ae9179e3a--368e1404efa648619d3e13689ad87c9f
a0b003ee2ab14095ab51cc8fb0f2b9b7
368e1404efa648619d3e13689ad87c9f--a0b003ee2ab14095ab51cc8fb0f2b9b7
a59f6eb205874fdab90db8ca8bae9854
HamEvo
a0b003ee2ab14095ab51cc8fb0f2b9b7--a59f6eb205874fdab90db8ca8bae9854
c45e45d240ef4f2380a24c1733041754
HamEvo
a59f6eb205874fdab90db8ca8bae9854--c45e45d240ef4f2380a24c1733041754
97b143bff4634722ae929520afb9a83b
c45e45d240ef4f2380a24c1733041754--97b143bff4634722ae929520afb9a83b
ced7502f2e54400481d813eaae8895ab
97b143bff4634722ae929520afb9a83b--ced7502f2e54400481d813eaae8895ab
40a271ef202d4afd8af10dc1f28c67ac
HamEvo
ced7502f2e54400481d813eaae8895ab--40a271ef202d4afd8af10dc1f28c67ac
8c4e94cc627e4e5a8a6ee1dab97c02ec
HamEvo
40a271ef202d4afd8af10dc1f28c67ac--8c4e94cc627e4e5a8a6ee1dab97c02ec
0167cc7f9e0e44cfb3cc34f9b209c000
X
8c4e94cc627e4e5a8a6ee1dab97c02ec--0167cc7f9e0e44cfb3cc34f9b209c000
a058cdabc6bd4151a663d12dd4d38d58
HamEvo
0167cc7f9e0e44cfb3cc34f9b209c000--a058cdabc6bd4151a663d12dd4d38d58
189b997707504bcab6f4402240563dcc
HamEvo
a058cdabc6bd4151a663d12dd4d38d58--189b997707504bcab6f4402240563dcc
b2d29de89b73442ba1bc8501bce0511e
X
189b997707504bcab6f4402240563dcc--b2d29de89b73442ba1bc8501bce0511e
60001b773796453b85a15102f84baf71
X
b2d29de89b73442ba1bc8501bce0511e--60001b773796453b85a15102f84baf71
6615570b8ab446aeb42d44de18d9903b
HamEvo
60001b773796453b85a15102f84baf71--6615570b8ab446aeb42d44de18d9903b
5b206365b1dd43f7a71854c7bfa66e28
HamEvo
6615570b8ab446aeb42d44de18d9903b--5b206365b1dd43f7a71854c7bfa66e28
4c5a58483e9045f7a92069a774624063
X
5b206365b1dd43f7a71854c7bfa66e28--4c5a58483e9045f7a92069a774624063
bc98f3bd0e38468eaae135d89c942eae
4c5a58483e9045f7a92069a774624063--bc98f3bd0e38468eaae135d89c942eae
d60dc5ae161345e99e5ff20034054c25
bc98f3bd0e38468eaae135d89c942eae--d60dc5ae161345e99e5ff20034054c25
77e3b99070c241439b0bfab679f0cb2c
15b82b59e67a47fc8e74af933a705e23
4faf06d09c4445c5855a7fcbd7009c9b--15b82b59e67a47fc8e74af933a705e23
df04bc8594d2405ab6f0b257360adf7f
2
4e94c1af3fa1471cb4e8c13f2033b8a2
t = -1.00000000000000
15b82b59e67a47fc8e74af933a705e23--4e94c1af3fa1471cb4e8c13f2033b8a2
0af5a923fea2413b8f92f27ac5804691
t = 2.356
4e94c1af3fa1471cb4e8c13f2033b8a2--0af5a923fea2413b8f92f27ac5804691
88ce1e88fca044ca9aac2c51d14de444
X
0af5a923fea2413b8f92f27ac5804691--88ce1e88fca044ca9aac2c51d14de444
6047c7d207e946f9ad11e90da8536a73
t = 0.393
88ce1e88fca044ca9aac2c51d14de444--6047c7d207e946f9ad11e90da8536a73
4728441920274650a847b7f60619eb85
t = 0.393
6047c7d207e946f9ad11e90da8536a73--4728441920274650a847b7f60619eb85
f522673ce16040d0b68ee6dd4a52e7e7
X
4728441920274650a847b7f60619eb85--f522673ce16040d0b68ee6dd4a52e7e7
6a660b4f0e1f48328a400665c0075b01
f522673ce16040d0b68ee6dd4a52e7e7--6a660b4f0e1f48328a400665c0075b01
544f506e109247a0a7c74b06f4dd69a7
t = 0.785
6a660b4f0e1f48328a400665c0075b01--544f506e109247a0a7c74b06f4dd69a7
d584889cc681401a839967ba2f1f0a40
t = 0.785
544f506e109247a0a7c74b06f4dd69a7--d584889cc681401a839967ba2f1f0a40
ef74eb4c846942a0ac8292cf87d3d018
d584889cc681401a839967ba2f1f0a40--ef74eb4c846942a0ac8292cf87d3d018
59bc5f67546541d0898fe308d48aac20
X
ef74eb4c846942a0ac8292cf87d3d018--59bc5f67546541d0898fe308d48aac20
74e4aff54916493b80ac6accf4b96d4b
t = 1.178
59bc5f67546541d0898fe308d48aac20--74e4aff54916493b80ac6accf4b96d4b
5062a69b08f34235a8fc793776173cba
t = 1.178
74e4aff54916493b80ac6accf4b96d4b--5062a69b08f34235a8fc793776173cba
5a313f9079ca4cb3aa73e98787800fa5
X
5062a69b08f34235a8fc793776173cba--5a313f9079ca4cb3aa73e98787800fa5
1499991a851841dbbe27c7dabad3d2ae
H
5a313f9079ca4cb3aa73e98787800fa5--1499991a851841dbbe27c7dabad3d2ae
d2e5aec1281d495b896f87b9653a4ac1
t = -1.00000000000000
1499991a851841dbbe27c7dabad3d2ae--d2e5aec1281d495b896f87b9653a4ac1
ea8618e20e07400b9ed7cef56496e22e
t = 1.571
d2e5aec1281d495b896f87b9653a4ac1--ea8618e20e07400b9ed7cef56496e22e
23de4372435a4480a2f9fdb04c0fd539
X
ea8618e20e07400b9ed7cef56496e22e--23de4372435a4480a2f9fdb04c0fd539
ba4a970185044e99a2fea795749e5710
t = 0.785
23de4372435a4480a2f9fdb04c0fd539--ba4a970185044e99a2fea795749e5710
a1ea960e3239432694ebfe7996a602d1
t = 0.785
ba4a970185044e99a2fea795749e5710--a1ea960e3239432694ebfe7996a602d1
db72bdd0e40b4699bc0c7bf192885c47
X
a1ea960e3239432694ebfe7996a602d1--db72bdd0e40b4699bc0c7bf192885c47
4718c44f82a648f4a22ec197394de558
db72bdd0e40b4699bc0c7bf192885c47--4718c44f82a648f4a22ec197394de558
1a773475dd7d4c3491918d764d3a8082
t = 0.785
4718c44f82a648f4a22ec197394de558--1a773475dd7d4c3491918d764d3a8082
9735cf3ac5e448048e3e851ac8ae6598
t = 0.785
1a773475dd7d4c3491918d764d3a8082--9735cf3ac5e448048e3e851ac8ae6598
cf79025b243e4ee8b3c6b2b99999f437
9735cf3ac5e448048e3e851ac8ae6598--cf79025b243e4ee8b3c6b2b99999f437
541b9c1175cf4ac7b55abdcba124a29e
cf79025b243e4ee8b3c6b2b99999f437--541b9c1175cf4ac7b55abdcba124a29e
541b9c1175cf4ac7b55abdcba124a29e--77e3b99070c241439b0bfab679f0cb2c
a2f6bbd25af84a99bf87160c143d36ab
112c656b8a0341298fb41696c455b3d5
df04bc8594d2405ab6f0b257360adf7f--112c656b8a0341298fb41696c455b3d5
578586e344fd4e92b0c75b440375127a
112c656b8a0341298fb41696c455b3d5--578586e344fd4e92b0c75b440375127a
9a0b21e8d1944934a9dfcd9323a5793b
578586e344fd4e92b0c75b440375127a--9a0b21e8d1944934a9dfcd9323a5793b
7b803100a82a43aab3c464af0bee8ef8
9a0b21e8d1944934a9dfcd9323a5793b--7b803100a82a43aab3c464af0bee8ef8
1acfd98950bf4195a2a255d5f91b97f6
7b803100a82a43aab3c464af0bee8ef8--1acfd98950bf4195a2a255d5f91b97f6
fd59ef65c67b4f2d9f3e945b839b6ea5
1acfd98950bf4195a2a255d5f91b97f6--fd59ef65c67b4f2d9f3e945b839b6ea5
6f6c80233b914c299c28cd498288ae68
fd59ef65c67b4f2d9f3e945b839b6ea5--6f6c80233b914c299c28cd498288ae68
c63d902f59074b0e9005cac620fbdc1c
X
6f6c80233b914c299c28cd498288ae68--c63d902f59074b0e9005cac620fbdc1c
28599b367c2e4d5fb2d46e09ecf079d8
c63d902f59074b0e9005cac620fbdc1c--28599b367c2e4d5fb2d46e09ecf079d8
79eaf4abf94943ebaec70c52eb548460
28599b367c2e4d5fb2d46e09ecf079d8--79eaf4abf94943ebaec70c52eb548460
c308a3ad8a744742a0eb82ff8782a365
X
79eaf4abf94943ebaec70c52eb548460--c308a3ad8a744742a0eb82ff8782a365
3be648e01bbc472f8ffa64adefdd21ce
X
c308a3ad8a744742a0eb82ff8782a365--3be648e01bbc472f8ffa64adefdd21ce
fc69173fce9943e29cbc09fb71e92b61
3be648e01bbc472f8ffa64adefdd21ce--fc69173fce9943e29cbc09fb71e92b61
df792a90c268409fa7d22300316b6d55
fc69173fce9943e29cbc09fb71e92b61--df792a90c268409fa7d22300316b6d55
858d18cb28d744e7b2a8fcff63d73520
X
df792a90c268409fa7d22300316b6d55--858d18cb28d744e7b2a8fcff63d73520
bc807502cf1e4e73a14057cb90324416
858d18cb28d744e7b2a8fcff63d73520--bc807502cf1e4e73a14057cb90324416
d217c898fbf74f15878ff0f5efffc96f
bc807502cf1e4e73a14057cb90324416--d217c898fbf74f15878ff0f5efffc96f
aa05fafd46a5483bb5721671becfa004
d217c898fbf74f15878ff0f5efffc96f--aa05fafd46a5483bb5721671becfa004
9bdb42f4e8e4469986e23b88c4edc350
aa05fafd46a5483bb5721671becfa004--9bdb42f4e8e4469986e23b88c4edc350
abdf7ab19b5949039edb908e3b15f65a
9bdb42f4e8e4469986e23b88c4edc350--abdf7ab19b5949039edb908e3b15f65a
fd9e5c0c9164444db293aa8f8baee2e1
abdf7ab19b5949039edb908e3b15f65a--fd9e5c0c9164444db293aa8f8baee2e1
ad2d53fcb515437e822a4e046c9947cb
fd9e5c0c9164444db293aa8f8baee2e1--ad2d53fcb515437e822a4e046c9947cb
677ba75c429f431a815ff38943d3687f
X
ad2d53fcb515437e822a4e046c9947cb--677ba75c429f431a815ff38943d3687f
a70487eae03249d89fc6045922ef0ed4
677ba75c429f431a815ff38943d3687f--a70487eae03249d89fc6045922ef0ed4
e14f5b501cb744419df82d26788a4f4c
a70487eae03249d89fc6045922ef0ed4--e14f5b501cb744419df82d26788a4f4c
61eac1e3c2004f528a40d49af060de20
X
e14f5b501cb744419df82d26788a4f4c--61eac1e3c2004f528a40d49af060de20
862d506686504823959003696c603fc6
H
61eac1e3c2004f528a40d49af060de20--862d506686504823959003696c603fc6
862d506686504823959003696c603fc6--a2f6bbd25af84a99bf87160c143d36ab
References