Quantum machine learning constructors
Besides the arbitrary Hamiltonian constructors , Qadence also provides a complete set of
program constructors useful for digital-analog quantum machine learning programs.
Feature maps
The feature_map
function can easily create several types of data-encoding blocks. The
two main types of feature maps use a Fourier basis or a Chebyshev basis.
from qadence import feature_map , BasisSet , chain
from qadence.draw import display
n_qubits = 3
fourier_fm = feature_map ( n_qubits , fm_type = BasisSet . FOURIER )
chebyshev_fm = feature_map ( n_qubits , fm_type = BasisSet . CHEBYSHEV )
block = chain ( fourier_fm , chebyshev_fm )
%3
cluster_2a3c919bf44d440dbbf18b8204476b47
Constant Chebyshev FM
cluster_60f40b6a52c74311b50c097e5a4116c8
Constant Fourier FM
05103472327142f7a27336b794de6130
0
846f158569b3435e93bbe2f095bfb6f6
RX(phi)
05103472327142f7a27336b794de6130--846f158569b3435e93bbe2f095bfb6f6
d11b5e64752346b6b6215087a75172e7
1
5db75aa2254a4e02aae743c1c5e227f3
RX(acos(phi))
846f158569b3435e93bbe2f095bfb6f6--5db75aa2254a4e02aae743c1c5e227f3
ec295beccb5042be8e4fc28a42cd0a7d
5db75aa2254a4e02aae743c1c5e227f3--ec295beccb5042be8e4fc28a42cd0a7d
c386d08c55154d26b8297b173e2a4ef5
de90b4c823a94580b28213c8f608878a
RX(phi)
d11b5e64752346b6b6215087a75172e7--de90b4c823a94580b28213c8f608878a
e9d4ed39ed0a48ed9046b37afa2a992e
2
e48f77c55c3f4f8b806f406dd6a365d1
RX(acos(phi))
de90b4c823a94580b28213c8f608878a--e48f77c55c3f4f8b806f406dd6a365d1
e48f77c55c3f4f8b806f406dd6a365d1--c386d08c55154d26b8297b173e2a4ef5
71a6892989d34f99b708673a327cfb82
f262ec539cbf401abeef5899e6238857
RX(phi)
e9d4ed39ed0a48ed9046b37afa2a992e--f262ec539cbf401abeef5899e6238857
e4878e70c8c9486a85d039a404e7af26
RX(acos(phi))
f262ec539cbf401abeef5899e6238857--e4878e70c8c9486a85d039a404e7af26
e4878e70c8c9486a85d039a404e7af26--71a6892989d34f99b708673a327cfb82
A custom encoding function can also be passed with sympy
from sympy import asin , Function
n_qubits = 3
# Using a pre-defined sympy Function
custom_fm_0 = feature_map ( n_qubits , fm_type = asin )
# Creating a custom function
def custom_fn ( x ):
return asin ( x ) + x ** 2
custom_fm_1 = feature_map ( n_qubits , fm_type = custom_fn )
block = chain ( custom_fm_0 , custom_fm_1 )
%3
cluster_11ea4c3d8a3848d69856308421791c9d
Constant <function custom_fn at 0x7f42ff3b4e50> FM
cluster_1a34ba4c08c5464db470706b579f47ee
Constant asin FM
bda13ffca9c44bc58df67ca8a07ab5fa
0
e629db72e7e04da39691d790c3acc923
RX(asin(phi))
bda13ffca9c44bc58df67ca8a07ab5fa--e629db72e7e04da39691d790c3acc923
4b3bdd53e0814c9ca5e984ef8be29224
1
3c7a63a93d5f432da8d3338ab8d83c56
RX(phi**2 + asin(phi))
e629db72e7e04da39691d790c3acc923--3c7a63a93d5f432da8d3338ab8d83c56
5705fbc545974cfeb4c48e2bc7c9b05f
3c7a63a93d5f432da8d3338ab8d83c56--5705fbc545974cfeb4c48e2bc7c9b05f
c1194dbb7cef43f5bf8e08bf675733e9
e3f94185918f461ca8f28be1df1ec3d5
RX(asin(phi))
4b3bdd53e0814c9ca5e984ef8be29224--e3f94185918f461ca8f28be1df1ec3d5
01d2877dd8d444ffa4c51c68ef560c01
2
336191983f444b06ba703e8f96fa204e
RX(phi**2 + asin(phi))
e3f94185918f461ca8f28be1df1ec3d5--336191983f444b06ba703e8f96fa204e
336191983f444b06ba703e8f96fa204e--c1194dbb7cef43f5bf8e08bf675733e9
caa168788b104e33ac84c41fa2c74790
2eca4cd4acb04d8db7856b47d9c3d2d6
RX(asin(phi))
01d2877dd8d444ffa4c51c68ef560c01--2eca4cd4acb04d8db7856b47d9c3d2d6
4257111c56ff4445a4cb167e3e0a69ba
RX(phi**2 + asin(phi))
2eca4cd4acb04d8db7856b47d9c3d2d6--4257111c56ff4445a4cb167e3e0a69ba
4257111c56ff4445a4cb167e3e0a69ba--caa168788b104e33ac84c41fa2c74790
Furthermore, the reupload_scaling
argument can be used to change the scaling applied to each qubit
in the support of the feature map. The default scalings can be chosen from the ReuploadScaling
enumeration.
from qadence import ReuploadScaling
from qadence.draw import display
n_qubits = 5
# Default constant value
fm_constant = feature_map ( n_qubits , fm_type = BasisSet . FOURIER , reupload_scaling = ReuploadScaling . CONSTANT )
# Linearly increasing scaling
fm_tower = feature_map ( n_qubits , fm_type = BasisSet . FOURIER , reupload_scaling = ReuploadScaling . TOWER )
# Exponentially increasing scaling
fm_exp = feature_map ( n_qubits , fm_type = BasisSet . FOURIER , reupload_scaling = ReuploadScaling . EXP )
block = chain ( fm_constant , fm_tower , fm_exp )
%3
cluster_f2dcc13ee1cb402f9faa8a33370c43c7
Exponential Fourier FM
cluster_066860be0c354f3dbf39f5817f98c8b5
Constant Fourier FM
cluster_053187b613ed435f9d29f60829c1ec28
Tower Fourier FM
72fbd371de5441ccb3f9ebe5bcbedf25
0
a004961f04634a1aba4cac0eefe6f6e1
RX(phi)
72fbd371de5441ccb3f9ebe5bcbedf25--a004961f04634a1aba4cac0eefe6f6e1
53c92be6733a4e2e8bfae3c28ea2f5ed
1
c887660d736140a8b732715078c40822
RX(1.0*phi)
a004961f04634a1aba4cac0eefe6f6e1--c887660d736140a8b732715078c40822
2c5cbe64ede646c7a8c0d4bad2671ba6
RX(1.0*phi)
c887660d736140a8b732715078c40822--2c5cbe64ede646c7a8c0d4bad2671ba6
a8649eaeee8d4b34806e283062e5f6c9
2c5cbe64ede646c7a8c0d4bad2671ba6--a8649eaeee8d4b34806e283062e5f6c9
5bb479b9b0a34be79ed5376bd841c28b
8d87217db3734b93bb787d67903ba785
RX(phi)
53c92be6733a4e2e8bfae3c28ea2f5ed--8d87217db3734b93bb787d67903ba785
cbdcfcd9eb274e858a4d1606c65cbd8f
2
856081183a7441f595be9752b5aaf333
RX(2.0*phi)
8d87217db3734b93bb787d67903ba785--856081183a7441f595be9752b5aaf333
dce4fdee68a3430b805a2b947ae332de
RX(2.0*phi)
856081183a7441f595be9752b5aaf333--dce4fdee68a3430b805a2b947ae332de
dce4fdee68a3430b805a2b947ae332de--5bb479b9b0a34be79ed5376bd841c28b
1b33338934684c1ab3afb1af51b98af9
c7d178fe9a774fd4961803018cf9169e
RX(phi)
cbdcfcd9eb274e858a4d1606c65cbd8f--c7d178fe9a774fd4961803018cf9169e
b39fcc765a1144fab2f9af87ea81cbdb
3
37622aebf51441a79deb721922eb150d
RX(3.0*phi)
c7d178fe9a774fd4961803018cf9169e--37622aebf51441a79deb721922eb150d
52cff6fd74c041bb90236b55f73f1399
RX(4.0*phi)
37622aebf51441a79deb721922eb150d--52cff6fd74c041bb90236b55f73f1399
52cff6fd74c041bb90236b55f73f1399--1b33338934684c1ab3afb1af51b98af9
158bc79f7ca744ce89a30cb23b3a87d6
26e6d330d10b4ab3a6213abced1e0ad0
RX(phi)
b39fcc765a1144fab2f9af87ea81cbdb--26e6d330d10b4ab3a6213abced1e0ad0
eb8b6f62a9d74f5aa75004bca4209986
4
54270543797e44b582b4ec634c03d09f
RX(4.0*phi)
26e6d330d10b4ab3a6213abced1e0ad0--54270543797e44b582b4ec634c03d09f
6af7ded7b45d4a93bc0681ff05fb53f0
RX(8.0*phi)
54270543797e44b582b4ec634c03d09f--6af7ded7b45d4a93bc0681ff05fb53f0
6af7ded7b45d4a93bc0681ff05fb53f0--158bc79f7ca744ce89a30cb23b3a87d6
11229f85c0144830be1bcce807dc3b85
444a9430a39b4110b0a696dfc77de129
RX(phi)
eb8b6f62a9d74f5aa75004bca4209986--444a9430a39b4110b0a696dfc77de129
c767342838b147aeb4edfcc76f2142f5
RX(5.0*phi)
444a9430a39b4110b0a696dfc77de129--c767342838b147aeb4edfcc76f2142f5
c96eec11f7394b19830c3179cfdce739
RX(16.0*phi)
c767342838b147aeb4edfcc76f2142f5--c96eec11f7394b19830c3179cfdce739
c96eec11f7394b19830c3179cfdce739--11229f85c0144830be1bcce807dc3b85
A custom scaling can also be defined with a function with an int
input and int
or float
output.
n_qubits = 5
def custom_scaling ( i : int ) -> int | float :
"""Sqrt(i+1)"""
return ( i + 1 ) ** ( 0.5 )
# Custom scaling function
fm_custom = feature_map ( n_qubits , fm_type = BasisSet . CHEBYSHEV , reupload_scaling = custom_scaling )
%3
89420a0918a744b48540652c7d75c92c
0
3a66d3ce4efb4b22b630625e076feb75
RX(1.0*acos(phi))
89420a0918a744b48540652c7d75c92c--3a66d3ce4efb4b22b630625e076feb75
5c3f0129c3a048af880fd28f3168f0ad
1
3e98c6fee6b641f1bfa69ffc46745c2c
3a66d3ce4efb4b22b630625e076feb75--3e98c6fee6b641f1bfa69ffc46745c2c
178cbb937c5841329ac2fc12cdfa7679
c8a09d6d12d64862b208eb0322b30175
RX(1.414*acos(phi))
5c3f0129c3a048af880fd28f3168f0ad--c8a09d6d12d64862b208eb0322b30175
6070ddc3fc184505b5f5a635a25cdf6d
2
c8a09d6d12d64862b208eb0322b30175--178cbb937c5841329ac2fc12cdfa7679
ed381dbaa7424acb9e9ad75410aacb44
877c884a0e3447d28edc76f187db5f33
RX(1.732*acos(phi))
6070ddc3fc184505b5f5a635a25cdf6d--877c884a0e3447d28edc76f187db5f33
4bff875b86ea47818318d012ce228fc4
3
877c884a0e3447d28edc76f187db5f33--ed381dbaa7424acb9e9ad75410aacb44
3b7b145d262e47c588b08be3949670d2
c9d68f274bc14a19a96e03bc56b780a3
RX(2.0*acos(phi))
4bff875b86ea47818318d012ce228fc4--c9d68f274bc14a19a96e03bc56b780a3
bf4560f7582a42faa7aa1eab61e6c941
4
c9d68f274bc14a19a96e03bc56b780a3--3b7b145d262e47c588b08be3949670d2
d2074470df324236a33ff8e125d03ed4
0a6fd1a458a4496f84d07b838308bb9a
RX(2.236*acos(phi))
bf4560f7582a42faa7aa1eab61e6c941--0a6fd1a458a4496f84d07b838308bb9a
0a6fd1a458a4496f84d07b838308bb9a--d2074470df324236a33ff8e125d03ed4
To add a trainable parameter that multiplies the feature parameter inside the encoding function,
simply pass a param_prefix
string:
n_qubits = 5
fm_trainable = feature_map (
n_qubits ,
fm_type = BasisSet . FOURIER ,
reupload_scaling = ReuploadScaling . EXP ,
param_prefix = "w" ,
)
%3
b36791bf39104495ad3059b283cedb37
0
eb5533fa99aa46cbbd5668e9660e68de
RX(1.0*phi*w₀)
b36791bf39104495ad3059b283cedb37--eb5533fa99aa46cbbd5668e9660e68de
7ac822a67f6f4527bc1062294b0f232c
1
ddfa7efac0eb4960ab63eb5391004387
eb5533fa99aa46cbbd5668e9660e68de--ddfa7efac0eb4960ab63eb5391004387
388b81d5a41b4fa7a7348824cee25bea
a72060199d49402694c49e2f7901c61b
RX(2.0*phi*w₁)
7ac822a67f6f4527bc1062294b0f232c--a72060199d49402694c49e2f7901c61b
594bd2c1a1ef431aba5baa50e133f5ee
2
a72060199d49402694c49e2f7901c61b--388b81d5a41b4fa7a7348824cee25bea
a39ca472b53b47ec994bb95db77b8339
0fe37a0d2a3c490e954aa6f97e3e2a7f
RX(4.0*phi*w₂)
594bd2c1a1ef431aba5baa50e133f5ee--0fe37a0d2a3c490e954aa6f97e3e2a7f
b49f92fe4b544bb8ba670d0c7cabfcbf
3
0fe37a0d2a3c490e954aa6f97e3e2a7f--a39ca472b53b47ec994bb95db77b8339
2a639363c7234588983c07684ffd4a29
6f0524a9e6b34e39bd6edbd288611d14
RX(8.0*phi*w₃)
b49f92fe4b544bb8ba670d0c7cabfcbf--6f0524a9e6b34e39bd6edbd288611d14
8b36a011db86476e8b34e399d2a7094b
4
6f0524a9e6b34e39bd6edbd288611d14--2a639363c7234588983c07684ffd4a29
138feea0f1124b3e9fa1d5292d042d7f
f7a79e26a5fa47a2b2e158f3579ecd06
RX(16.0*phi*w₄)
8b36a011db86476e8b34e399d2a7094b--f7a79e26a5fa47a2b2e158f3579ecd06
f7a79e26a5fa47a2b2e158f3579ecd06--138feea0f1124b3e9fa1d5292d042d7f
Note that for the Fourier feature map, the encoding function is simply \(f(x)=x\) . For other cases, like the Chebyshev acos()
encoding,
the trainable parameter may cause the feature value to be outside the domain of the encoding function. This will eventually be fixed
by adding range constraints to trainable parameters in Qadence.
A full description of the remaining arguments can be found in the feature_map
API reference . We provide an example below.
from qadence import RY
n_qubits = 5
# Custom scaling function
fm_full = feature_map (
n_qubits = n_qubits ,
support = tuple ( reversed ( range ( n_qubits ))), # Reverse the qubit support to run the scaling from bottom to top
param = "x" , # Change the name of the parameter
op = RY , # Change the rotation gate between RX, RY, RZ or PHASE
fm_type = BasisSet . CHEBYSHEV ,
reupload_scaling = ReuploadScaling . EXP ,
feature_range = ( - 1.0 , 2.0 ), # Range from which the input data comes from
target_range = ( 1.0 , 3.0 ), # Range the encoder assumes as the natural range
multiplier = 5.0 , # Extra multiplier, which can also be a Parameter
param_prefix = "w" , # Add trainable parameters
)
%3
f3f3fec0bfbb4cbda62bfcdc7ef4f3df
0
d8120163747649edb994c3d6f34666d6
RY(80.0*acos(w₄*(0.667*x + 1.667)))
f3f3fec0bfbb4cbda62bfcdc7ef4f3df--d8120163747649edb994c3d6f34666d6
3b71a5f64ea74b7fb13f21b4874ad52e
1
ea2542f263d147c9be960233af06a02c
d8120163747649edb994c3d6f34666d6--ea2542f263d147c9be960233af06a02c
4fe1bc37a1d94fa18fd8d1ae49a81768
7da74a606df44b719baa9b80295ab28f
RY(40.0*acos(w₃*(0.667*x + 1.667)))
3b71a5f64ea74b7fb13f21b4874ad52e--7da74a606df44b719baa9b80295ab28f
9e611c250efe4d0b857e45c06e0f0d7c
2
7da74a606df44b719baa9b80295ab28f--4fe1bc37a1d94fa18fd8d1ae49a81768
2074e3b2ea1344e28b2811468f7576c8
fd09eb0baef94f24a29e6e24d59dad1b
RY(20.0*acos(w₂*(0.667*x + 1.667)))
9e611c250efe4d0b857e45c06e0f0d7c--fd09eb0baef94f24a29e6e24d59dad1b
07d0c135e64f41179f4184ad71b314a5
3
fd09eb0baef94f24a29e6e24d59dad1b--2074e3b2ea1344e28b2811468f7576c8
ef602487c988469ba79faaf6905c9272
379e39e7f3d244d1be6e4aab2471fe26
RY(10.0*acos(w₁*(0.667*x + 1.667)))
07d0c135e64f41179f4184ad71b314a5--379e39e7f3d244d1be6e4aab2471fe26
21fc8fb5bc07457c90cb51d96f33c74c
4
379e39e7f3d244d1be6e4aab2471fe26--ef602487c988469ba79faaf6905c9272
c126bf80d1f44bc3b773612b94aa26d9
9c36eb55242d4549a4f2013761deacd0
RY(5.0*acos(w₀*(0.667*x + 1.667)))
21fc8fb5bc07457c90cb51d96f33c74c--9c36eb55242d4549a4f2013761deacd0
9c36eb55242d4549a4f2013761deacd0--c126bf80d1f44bc3b773612b94aa26d9
Hardware-efficient ansatz
Ansatze blocks for quantum machine-learning are typically built following the Hardware-Efficient Ansatz formalism (HEA).
Both fully digital and digital-analog HEAs can easily be built with the hea
function. By default,
the digital version is returned:
from qadence import hea
from qadence.draw import display
n_qubits = 3
depth = 2
ansatz = hea ( n_qubits , depth )
%3
5e6237039e6747e8a0e883ec0a16a40f
0
3fd84d2845c5439484bb1441404436f1
RX(theta₀)
5e6237039e6747e8a0e883ec0a16a40f--3fd84d2845c5439484bb1441404436f1
bc1b176d8eab40ef8f76c114dcd05214
1
b2a4fd15887a40e995ea715b98f96f5c
RY(theta₃)
3fd84d2845c5439484bb1441404436f1--b2a4fd15887a40e995ea715b98f96f5c
ea5bc4982b124df99d433a8fff303398
RX(theta₆)
b2a4fd15887a40e995ea715b98f96f5c--ea5bc4982b124df99d433a8fff303398
7308a7011a3742f4b946efd37116ab6e
ea5bc4982b124df99d433a8fff303398--7308a7011a3742f4b946efd37116ab6e
175c3f4dfc224559bca6b52e941244d4
7308a7011a3742f4b946efd37116ab6e--175c3f4dfc224559bca6b52e941244d4
a99c6b46f14a47a59288ddabc40e2067
RX(theta₉)
175c3f4dfc224559bca6b52e941244d4--a99c6b46f14a47a59288ddabc40e2067
51dced32561b414785389585e3442f04
RY(theta₁₂)
a99c6b46f14a47a59288ddabc40e2067--51dced32561b414785389585e3442f04
7f581195d7b3411b94bb01bdf880fffd
RX(theta₁₅)
51dced32561b414785389585e3442f04--7f581195d7b3411b94bb01bdf880fffd
ae4e7b86ecd04e11854e73a8c4f65319
7f581195d7b3411b94bb01bdf880fffd--ae4e7b86ecd04e11854e73a8c4f65319
09a013f5e4484029b216bae199c0c320
ae4e7b86ecd04e11854e73a8c4f65319--09a013f5e4484029b216bae199c0c320
ef75cca0d8274688875ae67202d98d3a
09a013f5e4484029b216bae199c0c320--ef75cca0d8274688875ae67202d98d3a
e19b1930bc3e4014a1100d8de246360e
01d28f84b6414bec82201a26ad1d90df
RX(theta₁)
bc1b176d8eab40ef8f76c114dcd05214--01d28f84b6414bec82201a26ad1d90df
4b38c77b7f3e4e78872db58fbd55f4cc
2
2519ac38c3e84602998fd546ac15ff26
RY(theta₄)
01d28f84b6414bec82201a26ad1d90df--2519ac38c3e84602998fd546ac15ff26
4e78ad3d5e0d452ea0cf029a1ac6d5d9
RX(theta₇)
2519ac38c3e84602998fd546ac15ff26--4e78ad3d5e0d452ea0cf029a1ac6d5d9
6134be8fc9bb4882a66e43dd5c297acf
X
4e78ad3d5e0d452ea0cf029a1ac6d5d9--6134be8fc9bb4882a66e43dd5c297acf
6134be8fc9bb4882a66e43dd5c297acf--7308a7011a3742f4b946efd37116ab6e
7116fa359be7433880cd2ff797b68345
6134be8fc9bb4882a66e43dd5c297acf--7116fa359be7433880cd2ff797b68345
2166e2551b9140db98b99e197430f3f6
RX(theta₁₀)
7116fa359be7433880cd2ff797b68345--2166e2551b9140db98b99e197430f3f6
ff942152e61f4615b7b306c29ec25f6e
RY(theta₁₃)
2166e2551b9140db98b99e197430f3f6--ff942152e61f4615b7b306c29ec25f6e
52f8ce20bef047cea586c2cb2da1e4b4
RX(theta₁₆)
ff942152e61f4615b7b306c29ec25f6e--52f8ce20bef047cea586c2cb2da1e4b4
7c1f586d9d7e4bdea8f4bdcd921a28a7
X
52f8ce20bef047cea586c2cb2da1e4b4--7c1f586d9d7e4bdea8f4bdcd921a28a7
7c1f586d9d7e4bdea8f4bdcd921a28a7--ae4e7b86ecd04e11854e73a8c4f65319
e764da7d80754416b911ea68d37ac477
7c1f586d9d7e4bdea8f4bdcd921a28a7--e764da7d80754416b911ea68d37ac477
e764da7d80754416b911ea68d37ac477--e19b1930bc3e4014a1100d8de246360e
b79cd7aef6b840f186d1cc52622567c8
a3645eb40043402aaefc761aaf21a4be
RX(theta₂)
4b38c77b7f3e4e78872db58fbd55f4cc--a3645eb40043402aaefc761aaf21a4be
a64d2e2907344e51a9f860909986d397
RY(theta₅)
a3645eb40043402aaefc761aaf21a4be--a64d2e2907344e51a9f860909986d397
5507629f5dd54dbab479c324bccd1ccc
RX(theta₈)
a64d2e2907344e51a9f860909986d397--5507629f5dd54dbab479c324bccd1ccc
5e31d4af5aef423697fa2722552b39a1
5507629f5dd54dbab479c324bccd1ccc--5e31d4af5aef423697fa2722552b39a1
0f21ef1e91444c37abb5739896d1d0ca
X
5e31d4af5aef423697fa2722552b39a1--0f21ef1e91444c37abb5739896d1d0ca
0f21ef1e91444c37abb5739896d1d0ca--7116fa359be7433880cd2ff797b68345
1f7da197c8ed438ea955fc1a00ad4ee0
RX(theta₁₁)
0f21ef1e91444c37abb5739896d1d0ca--1f7da197c8ed438ea955fc1a00ad4ee0
b8481c65b2bf4c619d7f3afd8c393cd1
RY(theta₁₄)
1f7da197c8ed438ea955fc1a00ad4ee0--b8481c65b2bf4c619d7f3afd8c393cd1
2cf68f95794c48fe9864199097427196
RX(theta₁₇)
b8481c65b2bf4c619d7f3afd8c393cd1--2cf68f95794c48fe9864199097427196
177c8f7c23ae4cba9fd59036197ffc0d
2cf68f95794c48fe9864199097427196--177c8f7c23ae4cba9fd59036197ffc0d
de3f73a46bc048ecb4b63c7c1d40dd43
X
177c8f7c23ae4cba9fd59036197ffc0d--de3f73a46bc048ecb4b63c7c1d40dd43
de3f73a46bc048ecb4b63c7c1d40dd43--e764da7d80754416b911ea68d37ac477
de3f73a46bc048ecb4b63c7c1d40dd43--b79cd7aef6b840f186d1cc52622567c8
As seen above, the rotation layers are automatically parameterized, and the prefix "theta"
can be changed with the param_prefix
argument.
Furthermore, both the single-qubit rotations and the two-qubit entangler can be customized with the operations
and entangler
argument. The operations can be passed as a list of single-qubit rotations, while the entangler should be either CNOT
, CZ
, CRX
, CRY
, CRZ
or CPHASE
.
from qadence import RX , RY , CPHASE
ansatz = hea (
n_qubits = n_qubits ,
depth = depth ,
param_prefix = "phi" ,
operations = [ RX , RY , RX ],
entangler = CPHASE
)
%3
81ccc9ee47a9437b976a813c4d20e7b1
0
4e796cdc904c40ffadfcaa2995a7ef44
RX(phi₀)
81ccc9ee47a9437b976a813c4d20e7b1--4e796cdc904c40ffadfcaa2995a7ef44
8ba8a7b8fd8249819c80b280021c49bd
1
037d52b98a0c48f5971e8123db9d69e3
RY(phi₃)
4e796cdc904c40ffadfcaa2995a7ef44--037d52b98a0c48f5971e8123db9d69e3
869a766f00d4495d88c5ea88ebd13652
RX(phi₆)
037d52b98a0c48f5971e8123db9d69e3--869a766f00d4495d88c5ea88ebd13652
691e366ad6ec4f1e889becab71687f76
869a766f00d4495d88c5ea88ebd13652--691e366ad6ec4f1e889becab71687f76
8ff56dbc235c422dbf618d41580d1176
691e366ad6ec4f1e889becab71687f76--8ff56dbc235c422dbf618d41580d1176
5749d4790b9947ebb074e6f3ffd9bc24
RX(phi₉)
8ff56dbc235c422dbf618d41580d1176--5749d4790b9947ebb074e6f3ffd9bc24
706c262773d24a47afefa808348181a7
RY(phi₁₂)
5749d4790b9947ebb074e6f3ffd9bc24--706c262773d24a47afefa808348181a7
02c218534eb243a5b91fb1d21b4fbcc6
RX(phi₁₅)
706c262773d24a47afefa808348181a7--02c218534eb243a5b91fb1d21b4fbcc6
fcbca14dc37b49c09cf9a46f725387a3
02c218534eb243a5b91fb1d21b4fbcc6--fcbca14dc37b49c09cf9a46f725387a3
ea1a88f37d674240bab6c8c0e4a4be92
fcbca14dc37b49c09cf9a46f725387a3--ea1a88f37d674240bab6c8c0e4a4be92
d9b16acceb734c818a12b7defc310d3f
ea1a88f37d674240bab6c8c0e4a4be92--d9b16acceb734c818a12b7defc310d3f
49ec643a1f4c4b5b9efe3c2bb414354c
e22e8b1ae6af415eb56b6a7b1b2b766e
RX(phi₁)
8ba8a7b8fd8249819c80b280021c49bd--e22e8b1ae6af415eb56b6a7b1b2b766e
14e288dba23047fdb3ae2f70364d722c
2
f8604aff72574a23b58bb6b804ccc1f1
RY(phi₄)
e22e8b1ae6af415eb56b6a7b1b2b766e--f8604aff72574a23b58bb6b804ccc1f1
adb5fb14a92344dcba235da2355218e4
RX(phi₇)
f8604aff72574a23b58bb6b804ccc1f1--adb5fb14a92344dcba235da2355218e4
9169b63a83634bfbba36cdf923060549
PHASE(phi_ent₀)
adb5fb14a92344dcba235da2355218e4--9169b63a83634bfbba36cdf923060549
9169b63a83634bfbba36cdf923060549--691e366ad6ec4f1e889becab71687f76
e3b2e4e0b3f94c8a9a851a5c1e01071b
9169b63a83634bfbba36cdf923060549--e3b2e4e0b3f94c8a9a851a5c1e01071b
ec9a95ac2bf24e599b68da03a9031b1d
RX(phi₁₀)
e3b2e4e0b3f94c8a9a851a5c1e01071b--ec9a95ac2bf24e599b68da03a9031b1d
801b75c38de042eea41018a921ebcacd
RY(phi₁₃)
ec9a95ac2bf24e599b68da03a9031b1d--801b75c38de042eea41018a921ebcacd
64713902004e4fdbbffe869965b3f2a7
RX(phi₁₆)
801b75c38de042eea41018a921ebcacd--64713902004e4fdbbffe869965b3f2a7
9749d5bfec6a41e3b4ffca7ceaaff58d
PHASE(phi_ent₂)
64713902004e4fdbbffe869965b3f2a7--9749d5bfec6a41e3b4ffca7ceaaff58d
9749d5bfec6a41e3b4ffca7ceaaff58d--fcbca14dc37b49c09cf9a46f725387a3
35366575f913495e92681534c38b60b1
9749d5bfec6a41e3b4ffca7ceaaff58d--35366575f913495e92681534c38b60b1
35366575f913495e92681534c38b60b1--49ec643a1f4c4b5b9efe3c2bb414354c
c6b93ca2cc904352aac58d89027b7b10
e07e647bad07444e91904b4b31eb8d1b
RX(phi₂)
14e288dba23047fdb3ae2f70364d722c--e07e647bad07444e91904b4b31eb8d1b
c03cb3bf07a944cc9f1a2b344561eff6
RY(phi₅)
e07e647bad07444e91904b4b31eb8d1b--c03cb3bf07a944cc9f1a2b344561eff6
f9d2a454a6e54557ae2cd6cb98d0cd81
RX(phi₈)
c03cb3bf07a944cc9f1a2b344561eff6--f9d2a454a6e54557ae2cd6cb98d0cd81
3695ac73b43c4ecea9463a7b86d24cac
f9d2a454a6e54557ae2cd6cb98d0cd81--3695ac73b43c4ecea9463a7b86d24cac
da4ddc0fdfd84c1bb4fbc18a6603ed49
PHASE(phi_ent₁)
3695ac73b43c4ecea9463a7b86d24cac--da4ddc0fdfd84c1bb4fbc18a6603ed49
da4ddc0fdfd84c1bb4fbc18a6603ed49--e3b2e4e0b3f94c8a9a851a5c1e01071b
204a304978184e1b980994733b1e19c5
RX(phi₁₁)
da4ddc0fdfd84c1bb4fbc18a6603ed49--204a304978184e1b980994733b1e19c5
e08a923046c54e58abe9a046b21d049e
RY(phi₁₄)
204a304978184e1b980994733b1e19c5--e08a923046c54e58abe9a046b21d049e
751a2483239744499f06f1d5bba11dc5
RX(phi₁₇)
e08a923046c54e58abe9a046b21d049e--751a2483239744499f06f1d5bba11dc5
d798ee7036ff4f429e96b0357f4b8e2a
751a2483239744499f06f1d5bba11dc5--d798ee7036ff4f429e96b0357f4b8e2a
6ffb9e0ae3514532a9cb4088bd5546f2
PHASE(phi_ent₃)
d798ee7036ff4f429e96b0357f4b8e2a--6ffb9e0ae3514532a9cb4088bd5546f2
6ffb9e0ae3514532a9cb4088bd5546f2--35366575f913495e92681534c38b60b1
6ffb9e0ae3514532a9cb4088bd5546f2--c6b93ca2cc904352aac58d89027b7b10
Having a truly hardware-efficient ansatz means that the entangling operation can be chosen according to each device's native interactions. Besides digital operations, in Qadence it is also possible to build digital-analog HEAs with the entanglement produced by the natural evolution of a set of interacting qubits, as natively implemented in neutral atom devices. As with other digital-analog functions, this can be controlled with the strategy
argument which can be chosen from the Strategy
enum type. Currently, only Strategy.DIGITAL
and Strategy.SDAQC
are available. By default, calling strategy = Strategy.SDAQC
will use a global entangling Hamiltonian with Ising-like \(NN\) interactions and constant interaction strength,
from qadence import Strategy
ansatz = hea (
n_qubits ,
depth = depth ,
strategy = Strategy . SDAQC
)
%3
cluster_18549228c8b84706b860e1c89f42e623
cluster_50b4374d091d4b339179fe1dc69b62c5
155ce39a00d14bbeb146057ca9642b51
0
78a2df046eaa407ba1b7ad545cb4fa14
RX(theta₀)
155ce39a00d14bbeb146057ca9642b51--78a2df046eaa407ba1b7ad545cb4fa14
d70ca84b7d08439d9e124d7f6e3c9268
1
138fbd477d214df68d84604a6e0e4591
RY(theta₃)
78a2df046eaa407ba1b7ad545cb4fa14--138fbd477d214df68d84604a6e0e4591
16d38f3d4c334b7f84ae3a92645084b0
RX(theta₆)
138fbd477d214df68d84604a6e0e4591--16d38f3d4c334b7f84ae3a92645084b0
a959eab3918d4f53adfc9f60f60bb874
HamEvo
16d38f3d4c334b7f84ae3a92645084b0--a959eab3918d4f53adfc9f60f60bb874
ac8f4c8537d94cbd9d54abbec0008d29
RX(theta₉)
a959eab3918d4f53adfc9f60f60bb874--ac8f4c8537d94cbd9d54abbec0008d29
68ed7c642bc1484fa1bbea1e7818d1b5
RY(theta₁₂)
ac8f4c8537d94cbd9d54abbec0008d29--68ed7c642bc1484fa1bbea1e7818d1b5
16fa4ae8aa6f45e094631e57f8ac9f0f
RX(theta₁₅)
68ed7c642bc1484fa1bbea1e7818d1b5--16fa4ae8aa6f45e094631e57f8ac9f0f
12c0e6fe0642437f87b287972937a9b4
HamEvo
16fa4ae8aa6f45e094631e57f8ac9f0f--12c0e6fe0642437f87b287972937a9b4
3c8aef83ab954c94a95d472f298b459c
12c0e6fe0642437f87b287972937a9b4--3c8aef83ab954c94a95d472f298b459c
2b3f3c1e9c884c3ab2c0453d639d071a
9c613ea4bab7457882c0f6095564f087
RX(theta₁)
d70ca84b7d08439d9e124d7f6e3c9268--9c613ea4bab7457882c0f6095564f087
9f7240cbcaeb4051bae4ea6390da929b
2
6f8c0b47dd084e28ae8e71c7d91c3614
RY(theta₄)
9c613ea4bab7457882c0f6095564f087--6f8c0b47dd084e28ae8e71c7d91c3614
5b4f8c47a2164aea81ddf63e02cf0650
RX(theta₇)
6f8c0b47dd084e28ae8e71c7d91c3614--5b4f8c47a2164aea81ddf63e02cf0650
fd9e289dc3124d1bafea4b584bf64c03
t = theta_t₀
5b4f8c47a2164aea81ddf63e02cf0650--fd9e289dc3124d1bafea4b584bf64c03
27e8931937dc4042b80517fc336b9891
RX(theta₁₀)
fd9e289dc3124d1bafea4b584bf64c03--27e8931937dc4042b80517fc336b9891
3fce889fd4d54d1a8e66f3693342f3d6
RY(theta₁₃)
27e8931937dc4042b80517fc336b9891--3fce889fd4d54d1a8e66f3693342f3d6
b6f1c234e9c14479be97560a6028213e
RX(theta₁₆)
3fce889fd4d54d1a8e66f3693342f3d6--b6f1c234e9c14479be97560a6028213e
21234a1fff1b4ab2b8e60ea17980891c
t = theta_t₁
b6f1c234e9c14479be97560a6028213e--21234a1fff1b4ab2b8e60ea17980891c
21234a1fff1b4ab2b8e60ea17980891c--2b3f3c1e9c884c3ab2c0453d639d071a
8a1d3172ce5b4e2e8404fc394bf2cddf
a1cd5d6bc2e14a0f81e6c59cb12f81b4
RX(theta₂)
9f7240cbcaeb4051bae4ea6390da929b--a1cd5d6bc2e14a0f81e6c59cb12f81b4
9eec982150e941bebd9634ece37b5760
RY(theta₅)
a1cd5d6bc2e14a0f81e6c59cb12f81b4--9eec982150e941bebd9634ece37b5760
b97dc76b34ff4fac8ddf164339360de8
RX(theta₈)
9eec982150e941bebd9634ece37b5760--b97dc76b34ff4fac8ddf164339360de8
61470d6a3ae1485f8db3d17b8fb83a78
b97dc76b34ff4fac8ddf164339360de8--61470d6a3ae1485f8db3d17b8fb83a78
b001a95fa4484aed8c8a3baaa1f148df
RX(theta₁₁)
61470d6a3ae1485f8db3d17b8fb83a78--b001a95fa4484aed8c8a3baaa1f148df
edad23a04a2944188a4f119b41cf6369
RY(theta₁₄)
b001a95fa4484aed8c8a3baaa1f148df--edad23a04a2944188a4f119b41cf6369
aa0dfce305aa4480a6a94513a72e8f08
RX(theta₁₇)
edad23a04a2944188a4f119b41cf6369--aa0dfce305aa4480a6a94513a72e8f08
76dcefb562bd46948b7e2880d16f1d04
aa0dfce305aa4480a6a94513a72e8f08--76dcefb562bd46948b7e2880d16f1d04
76dcefb562bd46948b7e2880d16f1d04--8a1d3172ce5b4e2e8404fc394bf2cddf
Note that, by default, only the time-parameter is automatically parameterized when building a digital-analog HEA. However, as described in the Hamiltonians tutorial , arbitrary interaction Hamiltonians can be easily built with the hamiltonian_factory
function, with both customized or fully parameterized interactions, and these can be directly passed as the entangler
for a customizable digital-analog HEA.
from qadence import hamiltonian_factory , Interaction , N , Register , hea
# Build a parameterized neutral-atom Hamiltonian following a honeycomb_lattice:
register = Register . honeycomb_lattice ( 1 , 1 )
entangler = hamiltonian_factory (
register ,
interaction = Interaction . NN ,
detuning = N ,
interaction_strength = "e" ,
detuning_strength = "n"
)
# Build a fully parameterized Digital-Analog HEA:
n_qubits = register . n_qubits
depth = 2
ansatz = hea (
n_qubits = register . n_qubits ,
depth = depth ,
operations = [ RX , RY , RX ],
entangler = entangler ,
strategy = Strategy . SDAQC
)
%3
cluster_90c2d8668ae14a268fa2bc6c544b2ad4
cluster_86d9463776bc4cb9ab4b6b158b406a1a
54f27adf4db84c6589a5c33e22bb39a5
0
9eaa0c0e04334e8fabb4652c9e88d449
RX(theta₀)
54f27adf4db84c6589a5c33e22bb39a5--9eaa0c0e04334e8fabb4652c9e88d449
25269bad448d48a0af5aedd5ddd20d4a
1
ffe1c2b604d24bc8a83b86910cbdec75
RY(theta₆)
9eaa0c0e04334e8fabb4652c9e88d449--ffe1c2b604d24bc8a83b86910cbdec75
db78c2ed62054aaa9eab4f4745a4f1bd
RX(theta₁₂)
ffe1c2b604d24bc8a83b86910cbdec75--db78c2ed62054aaa9eab4f4745a4f1bd
88c9a8a1980b473588a0f22ddd5049f1
db78c2ed62054aaa9eab4f4745a4f1bd--88c9a8a1980b473588a0f22ddd5049f1
37fe9bcbb25841f790d3042c4244b457
RX(theta₁₈)
88c9a8a1980b473588a0f22ddd5049f1--37fe9bcbb25841f790d3042c4244b457
aaf2a3d69a9044fe9a98e2e158c027da
RY(theta₂₄)
37fe9bcbb25841f790d3042c4244b457--aaf2a3d69a9044fe9a98e2e158c027da
f52dedd2a7da46c0bcc6b1d26dc4a581
RX(theta₃₀)
aaf2a3d69a9044fe9a98e2e158c027da--f52dedd2a7da46c0bcc6b1d26dc4a581
24c940b6a75840b7ae1290fa66bd2fb5
f52dedd2a7da46c0bcc6b1d26dc4a581--24c940b6a75840b7ae1290fa66bd2fb5
b152ba2bbf404b5fb18de40b31864ee5
24c940b6a75840b7ae1290fa66bd2fb5--b152ba2bbf404b5fb18de40b31864ee5
e15a765235ac4b6b9724ea2a998257d3
9318a982d46d4ecb82bae024055e2eac
RX(theta₁)
25269bad448d48a0af5aedd5ddd20d4a--9318a982d46d4ecb82bae024055e2eac
f8d75e7f5cb74ef3a5377c8ee9795c24
2
b7c18689920543f4a8130407195b19aa
RY(theta₇)
9318a982d46d4ecb82bae024055e2eac--b7c18689920543f4a8130407195b19aa
9953612e7b424b4da766af49c5b97aa1
RX(theta₁₃)
b7c18689920543f4a8130407195b19aa--9953612e7b424b4da766af49c5b97aa1
e784ac136cb544edb499f3a9ec9078bf
9953612e7b424b4da766af49c5b97aa1--e784ac136cb544edb499f3a9ec9078bf
4b814963ab0a4b78802ccfbfdb87c50d
RX(theta₁₉)
e784ac136cb544edb499f3a9ec9078bf--4b814963ab0a4b78802ccfbfdb87c50d
587894eaee5242b8a994957dbdabd45c
RY(theta₂₅)
4b814963ab0a4b78802ccfbfdb87c50d--587894eaee5242b8a994957dbdabd45c
274d758f7ca0489a972e34864b0e6b82
RX(theta₃₁)
587894eaee5242b8a994957dbdabd45c--274d758f7ca0489a972e34864b0e6b82
d98de957c22a4b169573682dc6115beb
274d758f7ca0489a972e34864b0e6b82--d98de957c22a4b169573682dc6115beb
d98de957c22a4b169573682dc6115beb--e15a765235ac4b6b9724ea2a998257d3
bcae686da8934217b63ce21ac0e3bb69
c015bb007718414d8559570342c8a1bf
RX(theta₂)
f8d75e7f5cb74ef3a5377c8ee9795c24--c015bb007718414d8559570342c8a1bf
98e188728d3d4aaea2174d19ea3223ba
3
0aeafdaa3e4643a2bfdda4ea8a125167
RY(theta₈)
c015bb007718414d8559570342c8a1bf--0aeafdaa3e4643a2bfdda4ea8a125167
b059752b02c041ed9b3596fdb978d0e5
RX(theta₁₄)
0aeafdaa3e4643a2bfdda4ea8a125167--b059752b02c041ed9b3596fdb978d0e5
872a433cb1c24e3abad4913eff0591ab
HamEvo
b059752b02c041ed9b3596fdb978d0e5--872a433cb1c24e3abad4913eff0591ab
242027b86e00421f83c502b0cef06050
RX(theta₂₀)
872a433cb1c24e3abad4913eff0591ab--242027b86e00421f83c502b0cef06050
c07cfb24f09a4b0089a78809f72ca4fe
RY(theta₂₆)
242027b86e00421f83c502b0cef06050--c07cfb24f09a4b0089a78809f72ca4fe
70f00e43d8454161a9be139b38fec8d2
RX(theta₃₂)
c07cfb24f09a4b0089a78809f72ca4fe--70f00e43d8454161a9be139b38fec8d2
39003915542f4457becbb8671daeca7a
HamEvo
70f00e43d8454161a9be139b38fec8d2--39003915542f4457becbb8671daeca7a
39003915542f4457becbb8671daeca7a--bcae686da8934217b63ce21ac0e3bb69
7192ae99736a45098ad619745eb36834
330944390417400dbbece4c140c3a121
RX(theta₃)
98e188728d3d4aaea2174d19ea3223ba--330944390417400dbbece4c140c3a121
d4e63f0e72d24d038608705a7c610ba4
4
a0be60bfc98341a99516c1f6f0a22bc3
RY(theta₉)
330944390417400dbbece4c140c3a121--a0be60bfc98341a99516c1f6f0a22bc3
47a8ae7ed0fd4345824b282efc9a59ef
RX(theta₁₅)
a0be60bfc98341a99516c1f6f0a22bc3--47a8ae7ed0fd4345824b282efc9a59ef
cafb498a7da64a8abb72d9649f266c5f
t = theta_t₀
47a8ae7ed0fd4345824b282efc9a59ef--cafb498a7da64a8abb72d9649f266c5f
4708dbd4711a4b0fa7b7a35426dcab37
RX(theta₂₁)
cafb498a7da64a8abb72d9649f266c5f--4708dbd4711a4b0fa7b7a35426dcab37
b217652dae1f4efab51821c935a63ada
RY(theta₂₇)
4708dbd4711a4b0fa7b7a35426dcab37--b217652dae1f4efab51821c935a63ada
1749e54fa8544cda988a4b9bd135718e
RX(theta₃₃)
b217652dae1f4efab51821c935a63ada--1749e54fa8544cda988a4b9bd135718e
78b72fcec8394bd7b13c2808e8e53271
t = theta_t₁
1749e54fa8544cda988a4b9bd135718e--78b72fcec8394bd7b13c2808e8e53271
78b72fcec8394bd7b13c2808e8e53271--7192ae99736a45098ad619745eb36834
9caa7ecc155a496e85dba92b4bc8912d
366f221567874542b904a71c8667ca18
RX(theta₄)
d4e63f0e72d24d038608705a7c610ba4--366f221567874542b904a71c8667ca18
27d69ce16fed44348005496c3ef14d88
5
0e90a3f757fd425c807a5ae3bb9a70e8
RY(theta₁₀)
366f221567874542b904a71c8667ca18--0e90a3f757fd425c807a5ae3bb9a70e8
5b277b4f2eab4ac8b1ef64d3b9096a57
RX(theta₁₆)
0e90a3f757fd425c807a5ae3bb9a70e8--5b277b4f2eab4ac8b1ef64d3b9096a57
517e25e1d6574f63bffca4b615717a27
5b277b4f2eab4ac8b1ef64d3b9096a57--517e25e1d6574f63bffca4b615717a27
77c4b9c3bc7b4c34ac7af5b24566727a
RX(theta₂₂)
517e25e1d6574f63bffca4b615717a27--77c4b9c3bc7b4c34ac7af5b24566727a
98eb8384b4f944418af494848aecb1d1
RY(theta₂₈)
77c4b9c3bc7b4c34ac7af5b24566727a--98eb8384b4f944418af494848aecb1d1
75123486665f4c54a803f4e7e1fe2958
RX(theta₃₄)
98eb8384b4f944418af494848aecb1d1--75123486665f4c54a803f4e7e1fe2958
bca960b1b9aa4d3b8695d3c81f117b02
75123486665f4c54a803f4e7e1fe2958--bca960b1b9aa4d3b8695d3c81f117b02
bca960b1b9aa4d3b8695d3c81f117b02--9caa7ecc155a496e85dba92b4bc8912d
a3e567c63f8148099a0ba879248eee6e
d5946b8112fc4484bb761223906b399e
RX(theta₅)
27d69ce16fed44348005496c3ef14d88--d5946b8112fc4484bb761223906b399e
32e70d62d14846a4865771c78befa024
RY(theta₁₁)
d5946b8112fc4484bb761223906b399e--32e70d62d14846a4865771c78befa024
b6298a2ea88c4594ae22f80d52d77e49
RX(theta₁₇)
32e70d62d14846a4865771c78befa024--b6298a2ea88c4594ae22f80d52d77e49
97da0bb4f526430eb8c7bb1c871f23de
b6298a2ea88c4594ae22f80d52d77e49--97da0bb4f526430eb8c7bb1c871f23de
f159f0d62b0e4ffd80bca0d238f768eb
RX(theta₂₃)
97da0bb4f526430eb8c7bb1c871f23de--f159f0d62b0e4ffd80bca0d238f768eb
d2cca495f8a042d0973d1fc6ec7ebe80
RY(theta₂₉)
f159f0d62b0e4ffd80bca0d238f768eb--d2cca495f8a042d0973d1fc6ec7ebe80
781244e5208047cdb9dad9f155ff4540
RX(theta₃₅)
d2cca495f8a042d0973d1fc6ec7ebe80--781244e5208047cdb9dad9f155ff4540
ea2b697d51a14e5581ece204340a2053
781244e5208047cdb9dad9f155ff4540--ea2b697d51a14e5581ece204340a2053
ea2b697d51a14e5581ece204340a2053--a3e567c63f8148099a0ba879248eee6e
Identity-initialized ansatz
It is widely known that parametrized quantum circuits are characterized by barren plateaus, where the gradient becomes exponentially small in the number of qubits. Here we include one of many techniques that have been proposed in recent years to mitigate this effect and facilitate QNN
s training: Grant et al. showed that initializing the weights of a QNN
so that each block of the circuit evaluates to identity reduces the effect of barren plateaus in the initial stage of training. In a similar fashion to hea
, such circuit can be created via calling the associated function, identity_initialized_ansatz
:
from qadence.constructors import identity_initialized_ansatz
from qadence.draw import display
n_qubits = 3
depth = 2
ansatz = identity_initialized_ansatz ( n_qubits , depth )
%3
cluster_d1f2d90ab2f64fd3a112da31b5549e8f
BPMA-1
cluster_77ed1bbaf97a4a16af1c19cdf135a682
BPMA-0
83d1df3beeef4828b70d100dda9b5565
0
a91701fb78c448f78564f069ac661525
RX(iia_α₀₀)
83d1df3beeef4828b70d100dda9b5565--a91701fb78c448f78564f069ac661525
3c31bf6d8fa6423faa011e09e43361aa
1
7c4c42a6f31e4d90b2a7c7935c222b06
RY(iia_α₀₃)
a91701fb78c448f78564f069ac661525--7c4c42a6f31e4d90b2a7c7935c222b06
cf48650bcdfc4d13b3e4f80adb007157
7c4c42a6f31e4d90b2a7c7935c222b06--cf48650bcdfc4d13b3e4f80adb007157
fc26d1923568438d9b1c421bd8ccd831
cf48650bcdfc4d13b3e4f80adb007157--fc26d1923568438d9b1c421bd8ccd831
dea2f1f42f03407a896d0e9940a197fd
RX(iia_γ₀₀)
fc26d1923568438d9b1c421bd8ccd831--dea2f1f42f03407a896d0e9940a197fd
7210b3e03d3342ec941753e7576d6497
dea2f1f42f03407a896d0e9940a197fd--7210b3e03d3342ec941753e7576d6497
fefde13434844f54adf1a798dbc49ddd
7210b3e03d3342ec941753e7576d6497--fefde13434844f54adf1a798dbc49ddd
54bbd6d0dde34ffc9bc8ece335c0d553
RY(iia_β₀₃)
fefde13434844f54adf1a798dbc49ddd--54bbd6d0dde34ffc9bc8ece335c0d553
2e8ec16ea798475fad4ac48dae27168e
RX(iia_β₀₀)
54bbd6d0dde34ffc9bc8ece335c0d553--2e8ec16ea798475fad4ac48dae27168e
cc6fb32916424286bd72d87d2850e429
RX(iia_α₁₀)
2e8ec16ea798475fad4ac48dae27168e--cc6fb32916424286bd72d87d2850e429
ca47ca7d5c114e8293caa9112726a07b
RY(iia_α₁₃)
cc6fb32916424286bd72d87d2850e429--ca47ca7d5c114e8293caa9112726a07b
6ab564a0632a40d289aa7b3208f7c4be
ca47ca7d5c114e8293caa9112726a07b--6ab564a0632a40d289aa7b3208f7c4be
942c1bb260074bef9202c013e5734864
6ab564a0632a40d289aa7b3208f7c4be--942c1bb260074bef9202c013e5734864
267e38dd56964c88bd53e82173e97ace
RX(iia_γ₁₀)
942c1bb260074bef9202c013e5734864--267e38dd56964c88bd53e82173e97ace
c84e55d622384a78b5631a85d12138df
267e38dd56964c88bd53e82173e97ace--c84e55d622384a78b5631a85d12138df
2778ec31e16943a78d70cf1b40461fba
c84e55d622384a78b5631a85d12138df--2778ec31e16943a78d70cf1b40461fba
507d52ba461a4d10812bd57632926563
RY(iia_β₁₃)
2778ec31e16943a78d70cf1b40461fba--507d52ba461a4d10812bd57632926563
f71226caece5438c9b847d22b046c809
RX(iia_β₁₀)
507d52ba461a4d10812bd57632926563--f71226caece5438c9b847d22b046c809
2f126dc9f6ac4c0dbb5849c7b7f0e10b
f71226caece5438c9b847d22b046c809--2f126dc9f6ac4c0dbb5849c7b7f0e10b
521c48755c7c4b458ab896724ae457fb
3c8502ee93b44461b39bfa2039eda592
RX(iia_α₀₁)
3c31bf6d8fa6423faa011e09e43361aa--3c8502ee93b44461b39bfa2039eda592
ac2387f343ca43baa7d1372d7b3a031d
2
52bf029ee3d14455a32fd1f941c90c16
RY(iia_α₀₄)
3c8502ee93b44461b39bfa2039eda592--52bf029ee3d14455a32fd1f941c90c16
3f3515df77024fefa9c63bcc12e4c739
X
52bf029ee3d14455a32fd1f941c90c16--3f3515df77024fefa9c63bcc12e4c739
3f3515df77024fefa9c63bcc12e4c739--cf48650bcdfc4d13b3e4f80adb007157
ea758ab6728f4920a1f70e63b25b1db1
3f3515df77024fefa9c63bcc12e4c739--ea758ab6728f4920a1f70e63b25b1db1
f6b0a09e9f84463f8adc77cb088efc43
RX(iia_γ₀₁)
ea758ab6728f4920a1f70e63b25b1db1--f6b0a09e9f84463f8adc77cb088efc43
dd233040880d441f9d1f431cc232af14
f6b0a09e9f84463f8adc77cb088efc43--dd233040880d441f9d1f431cc232af14
f80bf581d607481082228f503cacf3da
X
dd233040880d441f9d1f431cc232af14--f80bf581d607481082228f503cacf3da
f80bf581d607481082228f503cacf3da--fefde13434844f54adf1a798dbc49ddd
9c21a5283a804cd2ab24201717a923bc
RY(iia_β₀₄)
f80bf581d607481082228f503cacf3da--9c21a5283a804cd2ab24201717a923bc
ea51213b0ee84b54b443366c9b8f0abe
RX(iia_β₀₁)
9c21a5283a804cd2ab24201717a923bc--ea51213b0ee84b54b443366c9b8f0abe
35bca324a4c34c0c8965e4ba89fee87b
RX(iia_α₁₁)
ea51213b0ee84b54b443366c9b8f0abe--35bca324a4c34c0c8965e4ba89fee87b
1ee77b48ec4d4be39fb559f8f66240e4
RY(iia_α₁₄)
35bca324a4c34c0c8965e4ba89fee87b--1ee77b48ec4d4be39fb559f8f66240e4
d687ef74b07640b2b90ead49c9f862fe
X
1ee77b48ec4d4be39fb559f8f66240e4--d687ef74b07640b2b90ead49c9f862fe
d687ef74b07640b2b90ead49c9f862fe--6ab564a0632a40d289aa7b3208f7c4be
2a2a642aaec54faa88af830a9a712e74
d687ef74b07640b2b90ead49c9f862fe--2a2a642aaec54faa88af830a9a712e74
b65756c31c6345d8a0b15faae507d209
RX(iia_γ₁₁)
2a2a642aaec54faa88af830a9a712e74--b65756c31c6345d8a0b15faae507d209
384533b8c741444c836951ac027dc61e
b65756c31c6345d8a0b15faae507d209--384533b8c741444c836951ac027dc61e
47df69496ef04c2296acb24175f000d0
X
384533b8c741444c836951ac027dc61e--47df69496ef04c2296acb24175f000d0
47df69496ef04c2296acb24175f000d0--2778ec31e16943a78d70cf1b40461fba
ced680c1e49c40e7b14ec6fc3862d1f5
RY(iia_β₁₄)
47df69496ef04c2296acb24175f000d0--ced680c1e49c40e7b14ec6fc3862d1f5
eff86bdf901b4395889faa48a275bc5f
RX(iia_β₁₁)
ced680c1e49c40e7b14ec6fc3862d1f5--eff86bdf901b4395889faa48a275bc5f
eff86bdf901b4395889faa48a275bc5f--521c48755c7c4b458ab896724ae457fb
c155b8c423ae4688bf0b8ffd3ec71d4f
414b09eddfdf4e3faa4a1f73d8cde815
RX(iia_α₀₂)
ac2387f343ca43baa7d1372d7b3a031d--414b09eddfdf4e3faa4a1f73d8cde815
55630beb478547b588ec59894afd7d00
RY(iia_α₀₅)
414b09eddfdf4e3faa4a1f73d8cde815--55630beb478547b588ec59894afd7d00
fc3a0bec4cb5435e9de4fbed005b9769
55630beb478547b588ec59894afd7d00--fc3a0bec4cb5435e9de4fbed005b9769
c5815cfa6f4f40a2a2d68e4503ffee50
X
fc3a0bec4cb5435e9de4fbed005b9769--c5815cfa6f4f40a2a2d68e4503ffee50
c5815cfa6f4f40a2a2d68e4503ffee50--ea758ab6728f4920a1f70e63b25b1db1
55b253abb54f4321a11f55ea59e35111
RX(iia_γ₀₂)
c5815cfa6f4f40a2a2d68e4503ffee50--55b253abb54f4321a11f55ea59e35111
17201ea2e0c74974b2aca6d5e02ae3b1
X
55b253abb54f4321a11f55ea59e35111--17201ea2e0c74974b2aca6d5e02ae3b1
17201ea2e0c74974b2aca6d5e02ae3b1--dd233040880d441f9d1f431cc232af14
0d81e14a68ff4743ac29891cdd5b05f4
17201ea2e0c74974b2aca6d5e02ae3b1--0d81e14a68ff4743ac29891cdd5b05f4
800b059a4d9c44948609ba29df775f1f
RY(iia_β₀₅)
0d81e14a68ff4743ac29891cdd5b05f4--800b059a4d9c44948609ba29df775f1f
0a8d7e4e88414068830300e4799f878d
RX(iia_β₀₂)
800b059a4d9c44948609ba29df775f1f--0a8d7e4e88414068830300e4799f878d
4330b9bcf4c844f18bdddadf342dfedf
RX(iia_α₁₂)
0a8d7e4e88414068830300e4799f878d--4330b9bcf4c844f18bdddadf342dfedf
24feee3b4d6e4e66a2e296d7c3157398
RY(iia_α₁₅)
4330b9bcf4c844f18bdddadf342dfedf--24feee3b4d6e4e66a2e296d7c3157398
bc7ed4d902154788a2b5a878899b69fa
24feee3b4d6e4e66a2e296d7c3157398--bc7ed4d902154788a2b5a878899b69fa
c55f28fb23d6494296df2852eff94480
X
bc7ed4d902154788a2b5a878899b69fa--c55f28fb23d6494296df2852eff94480
c55f28fb23d6494296df2852eff94480--2a2a642aaec54faa88af830a9a712e74
7ecd73452fa949b39cb77da816deef25
RX(iia_γ₁₂)
c55f28fb23d6494296df2852eff94480--7ecd73452fa949b39cb77da816deef25
44d6d36717544b47b0a16ae37ce4d9d5
X
7ecd73452fa949b39cb77da816deef25--44d6d36717544b47b0a16ae37ce4d9d5
44d6d36717544b47b0a16ae37ce4d9d5--384533b8c741444c836951ac027dc61e
216a81fc8c1a4234888c3ca8523bb55f
44d6d36717544b47b0a16ae37ce4d9d5--216a81fc8c1a4234888c3ca8523bb55f
b52e24d80d044135bbc6e55be3fd967f
RY(iia_β₁₅)
216a81fc8c1a4234888c3ca8523bb55f--b52e24d80d044135bbc6e55be3fd967f
f90f3c7c133846e0a8a5c121e886dc12
RX(iia_β₁₂)
b52e24d80d044135bbc6e55be3fd967f--f90f3c7c133846e0a8a5c121e886dc12
f90f3c7c133846e0a8a5c121e886dc12--c155b8c423ae4688bf0b8ffd3ec71d4f