Skip to content

DAQC Transform

Digital-analog quantum computing focuses on using simple digital gates combined with more complex and device-dependent analog interactions to represent quantum programs. Such techniques have been shown to be universal for quantum computation 1. However, while this approach may have advantages when adapting quantum programs to real devices, known quantum algorithms are very often expressed in a fully digital paradigm. As such, it is also important to have concrete ways to transform from one paradigm to another.

In this tutorial we will exemplify this transformation starting with the representation of a simple digital CNOT using the universality of the Ising Hamiltonian 2.

CNOT with CPHASE

Let's look at a single example of how the digital-analog transformation can be used to perform a CNOT on two qubits inside a register of globally interacting qubits.

First, note that the CNOT can be decomposed with two Hadamard and a CPHASE gate with \(\phi=\pi\):

import torch
import qadence as qd

from qadence.draw import display
from qadence import X, I, Z, H, N, CPHASE, CNOT, HamEvo

n_qubits = 2

# CNOT gate
cnot_gate = CNOT(0, 1)

# CNOT decomposed
phi = torch.pi
cnot_decomp = qd.chain(H(1), CPHASE(0, 1, phi), H(1))

init_state = qd.product_state("10")

print(qd.sample(n_qubits, block = cnot_gate, state = init_state, n_shots = 100))
print(qd.sample(n_qubits, block = cnot_decomp, state = init_state, n_shots = 100))
[Counter({'11': 100})]
[Counter({'11': 100})]

The CPHASE gate is fully diagonal, and can be implemented by exponentiating an Ising-like Hamiltonian, or generator,

\[\text{CPHASE}(i,j,\phi)=\text{exp}\left(-i\phi \mathcal{H}_\text{CP}(i, j)\right)\]
\[\begin{aligned} \mathcal{H}_\text{CP}&=-\frac{1}{4}(I_i-Z_i)(I_j-Z_j)\\ &=-N_iN_j \end{aligned}\]

where we used the number operator \(N_i = \frac{1}{2}(I_i-Z_i)\), leading to an Ising-like interaction \(N_iN_j\) that is common in neutral-atom systems. Let's rebuild the CNOT using this evolution.

# Hamiltonian for the CPHASE gate
h_cphase = (-1.0) * qd.kron(N(0), N(1))

# Exponentiating the Hamiltonian
cphase_evo = HamEvo(h_cphase, phi)

# Check that we have the CPHASE gate:
cphase_matrix = qd.block_to_tensor(CPHASE(0, 1, phi))
cphase_evo_matrix = qd.block_to_tensor(cphase_evo)

assert torch.allclose(cphase_matrix, cphase_evo_matrix)

Now that we have checked the generator of the CPHASE gate, we can use it to apply the CNOT:

# CNOT with Hamiltonian Evolution
cnot_evo = qd.chain(
    H(1),
    cphase_evo,
    H(1)
)

init_state = qd.product_state("10")

print(qd.sample(n_qubits, block = cnot_gate, state = init_state, n_shots = 100))
print(qd.sample(n_qubits, block = cnot_evo, state = init_state, n_shots = 100))
[Counter({'11': 100})]
[Counter({'11': 100})]

Thus, a CNOT gate can be applied by combining a few single-qubit gates together with a 2-qubit Ising interaction between the control and the target qubit. This is important because it now allows us to exemplify the usage of the Ising transform proposed in the DAQC paper 2. In the paper, the transform is described for \(ZZ\) interactions. In qadence it works both with \(ZZ\) and \(NN\) interactions.

CNOT in an interacting system of 3 qubits

Consider a simple experimental setup with \(n=3\) interacting qubits in a triangular grid. For simplicity let's consider that all qubits interact with each other with an Ising (\(NN\)) interaction of constant strength \(g_\text{int}\). The Hamiltonian for the system can be written by summing this interaction over all pairs:

\[\mathcal{H}_\text{sys}=\sum_{i=0}^{n}\sum_{j=0}^{i-1}g_\text{int}N_iN_j,\]

which in this case leads to only three interaction terms,

\[\mathcal{H}_\text{sys}=g_\text{int}(N_0N_1+N_1N_2+N_0N_2)\]

This generator can be easily built:

n_qubits = 3

g_int = 1.0

interaction_list = []
for i in range(n_qubits):
    for j in range(i):
        interaction_list.append(g_int * qd.kron(N(i), N(j)))

h_sys = qd.add(*interaction_list)

print(h_sys)
AddBlock(0,1,2)
├── [mul: 1.00000000000000] 
   └── KronBlock(0,1)
       ├── N(1)
       └── N(0)
├── [mul: 1.00000000000000] 
   └── KronBlock(0,2)
       ├── N(2)
       └── N(0)
└── [mul: 1.00000000000000] 
    └── KronBlock(1,2)
        ├── N(2)
        └── N(1)

Now let's consider that the experimental system is fixed, and we cannot isolate the qubits from each other. All we can do is the following:

  • Turn on or off the global system Hamiltonian.
  • Perform single-qubit rotations on individual qubits.

How can we perform a CNOT on two specific qubits of our choice?

To perform a fully digital CNOT we would need to isolate the control and target qubit from the third one and have those interact to implement the gate directly. While this may be relatively simple for a 3-qubit system, the experimental burden becomes much greater when we start going into the dozens of qubits.

However, with the digital-analog paradigm that is not the case! In fact, we can represent the two qubit Ising interaction required for the CNOT by combining the global system Hamiltonian with a specific set of single-qubit rotations. The full details of this transformation are described in the DAQC paper 2, and it is available in qadence by calling the daqc_transform function.

The daqc_transform function will essentially return a program that represents the evolution of an Hamiltonian \(H_\text{target}\) (target Hamiltonian) for a specified time \(t_f\) by using only the evolution of an Hamiltonian \(H_\text{build}\) (build Hamiltonian) for specific intervals of time together with specific single-qubit \(X\) rotations. Currently, in qadence it is available for resource and target Hamiltonians composed only of \(ZZ\) or \(NN\) interactions. The generators are parsed by the daqc_transform function, the appropriate type is automatically determined, and the appropriate single-qubit detunings and global phases are applied.

Let's exemplify it for our CNOT problem:

# The target operation
i = 0  # Control
j = 1  # Target
k = 2  # The extra qubit

# CNOT on control and target, Identity on the extra qubit
cnot_target = qd.kron(CNOT(i, j), I(k))

# The two-qubit Ising (NN) interaction for the CPHASE
h_int = (-1.0) * qd.kron(N(i), N(j))

# Transforming the two-qubit Ising interaction using only our system Hamiltonian
transformed_ising = qd.daqc_transform(
    n_qubits = 3,        # Total number of qubits in the transformation
    gen_target = h_int,  # The target Ising generator
    t_f = torch.pi,      # The target evolution time
    gen_build = h_sys,   # The building block Ising generator to be used
    strategy = "sDAQC",   # Currently only sDAQC is implemented
    ignore_global_phases = False  # Global phases from mapping between Z and N
)

# display(transformed_ising)
%3 cluster_444a7cfb77c54a37b7d4e3aed299111e cluster_b127a1c2f97e4a17884e055febd56d4e cluster_733197a7a09442d29c1627276ce72a2b cluster_40889bc98aac4dd6be745b196022a491 cluster_1db65387a354466cbc7e3979d9328747 cluster_4ad24a8ac18a4b08838c4ba5a1e670c5 cluster_da30668bf757458d9a53f5410468d50a 3d6864a970404f3c95064188a898fc65 0 3c8bbde6e77f45e1b295d835ea169488 HamEvo 3d6864a970404f3c95064188a898fc65--3c8bbde6e77f45e1b295d835ea169488 6ed6c702a8a84d47bf249fed7221b04f 1 bae3ba5dc84045228cb14eaeded66d83 HamEvo 3c8bbde6e77f45e1b295d835ea169488--bae3ba5dc84045228cb14eaeded66d83 c4b405ae85964c2dbf3098aa2cb7d6c8 HamEvo bae3ba5dc84045228cb14eaeded66d83--c4b405ae85964c2dbf3098aa2cb7d6c8 f68b9ad63e31497a97b9f0ab536b3c13 X c4b405ae85964c2dbf3098aa2cb7d6c8--f68b9ad63e31497a97b9f0ab536b3c13 a7e486e707e447d48f024b2cd168bab6 HamEvo f68b9ad63e31497a97b9f0ab536b3c13--a7e486e707e447d48f024b2cd168bab6 199349f316f84c4aa7cd9302b1921c4f HamEvo a7e486e707e447d48f024b2cd168bab6--199349f316f84c4aa7cd9302b1921c4f 1e7a8102fa374c7fa513ed2b4fd53e7b X 199349f316f84c4aa7cd9302b1921c4f--1e7a8102fa374c7fa513ed2b4fd53e7b c7e5d369afd94eb8a7d4f535df8ceb3e 1e7a8102fa374c7fa513ed2b4fd53e7b--c7e5d369afd94eb8a7d4f535df8ceb3e c231cf7d56e54afbace91d67d061221e HamEvo c7e5d369afd94eb8a7d4f535df8ceb3e--c231cf7d56e54afbace91d67d061221e c26296c17eb2470e8bcd120f7ce84cc2 HamEvo c231cf7d56e54afbace91d67d061221e--c26296c17eb2470e8bcd120f7ce84cc2 c94b389b22b34824a7c6cdf4b582ef1f c26296c17eb2470e8bcd120f7ce84cc2--c94b389b22b34824a7c6cdf4b582ef1f 06dc3148f27b4d08af5e4278d5667a0a c94b389b22b34824a7c6cdf4b582ef1f--06dc3148f27b4d08af5e4278d5667a0a f96e14fe58f9440fb82ea6ab0363b2f8 d12f7b0ffd204219a1e58033ce54a266 t = -3.142 6ed6c702a8a84d47bf249fed7221b04f--d12f7b0ffd204219a1e58033ce54a266 f354e48a64a943ba8cff7b24d7798fc5 2 7ba1b50b2dd04b25bebd666e5abe30c9 t = 3.142 d12f7b0ffd204219a1e58033ce54a266--7ba1b50b2dd04b25bebd666e5abe30c9 3832c5eeeb8b440db5bb7f9cbed852f3 t = -3.142 7ba1b50b2dd04b25bebd666e5abe30c9--3832c5eeeb8b440db5bb7f9cbed852f3 6dc8ae2a63a04018b222b24a9e7c97b0 3832c5eeeb8b440db5bb7f9cbed852f3--6dc8ae2a63a04018b222b24a9e7c97b0 d9b0984b5b3545c79233c132a6298733 t = 1.571 6dc8ae2a63a04018b222b24a9e7c97b0--d9b0984b5b3545c79233c132a6298733 b835e6cfd6f244a5b463b455bc3f066d t = 1.571 d9b0984b5b3545c79233c132a6298733--b835e6cfd6f244a5b463b455bc3f066d ff8c271ff66e454dbd1c2414132c6206 b835e6cfd6f244a5b463b455bc3f066d--ff8c271ff66e454dbd1c2414132c6206 2914883dc510406ab2dbee7dca47729b X ff8c271ff66e454dbd1c2414132c6206--2914883dc510406ab2dbee7dca47729b 6011592d3eaa418585fea742b2e29d9a t = 1.571 2914883dc510406ab2dbee7dca47729b--6011592d3eaa418585fea742b2e29d9a 4f61da74b4ef4d269830107daa17f66c t = 1.571 6011592d3eaa418585fea742b2e29d9a--4f61da74b4ef4d269830107daa17f66c f0a81a04a8484a18a743bbe250f9096b X 4f61da74b4ef4d269830107daa17f66c--f0a81a04a8484a18a743bbe250f9096b f0a81a04a8484a18a743bbe250f9096b--f96e14fe58f9440fb82ea6ab0363b2f8 0a0946591dad45ed86bef58c21f27c25 2658696b48144e00b823c636c7a1cd56 f354e48a64a943ba8cff7b24d7798fc5--2658696b48144e00b823c636c7a1cd56 1d67b7b6c93c4a1fac4e43292dbbe06c 2658696b48144e00b823c636c7a1cd56--1d67b7b6c93c4a1fac4e43292dbbe06c d84fd8ff322d4acd9ce582cc6e2a192c 1d67b7b6c93c4a1fac4e43292dbbe06c--d84fd8ff322d4acd9ce582cc6e2a192c 2429ab127175464a858cf15fe6790b13 X d84fd8ff322d4acd9ce582cc6e2a192c--2429ab127175464a858cf15fe6790b13 f50e58f53b4344d09efd09d0ee7d091f 2429ab127175464a858cf15fe6790b13--f50e58f53b4344d09efd09d0ee7d091f 8cb7868469fa4a8a9039cf48563b284b f50e58f53b4344d09efd09d0ee7d091f--8cb7868469fa4a8a9039cf48563b284b 548fbb69a0554333abc9cdb2d8d2a8c0 X 8cb7868469fa4a8a9039cf48563b284b--548fbb69a0554333abc9cdb2d8d2a8c0 82fa5c5a5f4145edb0ce36396585d156 X 548fbb69a0554333abc9cdb2d8d2a8c0--82fa5c5a5f4145edb0ce36396585d156 e868d3a7425d4243afb6f3182490dfcc 82fa5c5a5f4145edb0ce36396585d156--e868d3a7425d4243afb6f3182490dfcc 1cd0f4d4fc944c9b9bcd0a032ad2167f e868d3a7425d4243afb6f3182490dfcc--1cd0f4d4fc944c9b9bcd0a032ad2167f b67d3686139f4ae9a2fe1b008944df73 X 1cd0f4d4fc944c9b9bcd0a032ad2167f--b67d3686139f4ae9a2fe1b008944df73 b67d3686139f4ae9a2fe1b008944df73--0a0946591dad45ed86bef58c21f27c25

The circuit above actually only uses two evolutions of the global Hamiltonian. In the displayed circuit also see other instances of HamEvo which account for global-phases and single-qubit detunings related to the mapping between the \(Z\) and \(N\) operator. Optionally, the application of the global phases can also be ignored, as shown in the input of daqc_transform. This will not create exactly the same state or operator matrix in tensor form, but in practice they will be equivalent.

In general, the mapping of a \(n\)-qubit Ising Hamiltonian will require at most \(n(n-1)\) evolutions. The transformed circuit performs these evolutions for specific times that are computed from the solution of a linear system of equations involving the set of interactions in the target and build Hamiltonians.

In this case the mapping is exact, since we used the step-wise DAQC technique (sDAQC). In banged DAQC (bDAQC) the mapping is not exact, but is easier to implement on a physical device with always-on interactions such as neutral-atom systems. Currently, only the sDAQC technique is available in qadence.

Just as before, we can check that using the transformed Ising circuit we exactly recover the CPHASE gate:

# CPHASE on (i, j), Identity on third qubit:
cphase_matrix = qd.block_to_tensor(qd.kron(CPHASE(i, j, phi), I(k)))

# CPHASE using the transformed circuit:
cphase_evo_matrix = qd.block_to_tensor(transformed_ising)

# Will fail if global phases are ignored:
assert torch.allclose(cphase_matrix, cphase_evo_matrix)

And we can now build the CNOT gate:

cnot_daqc = qd.chain(
    H(j),
    transformed_ising,
    H(j)
)

# And finally run the CNOT on a specific 3-qubit initial state:
init_state = qd.product_state("101")

# Check we get an equivalent wavefunction (will still pass if global phases are ignored)
wf_cnot = qd.run(n_qubits, block = cnot_target, state = init_state)
wf_daqc = qd.run(n_qubits, block = cnot_daqc, state = init_state)
assert qd.equivalent_state(wf_cnot, wf_daqc)

# Visualize the CNOT bit-flip:
print(qd.sample(n_qubits, block = cnot_target, state = init_state, n_shots = 100))
print(qd.sample(n_qubits, block = cnot_daqc, state = init_state, n_shots = 100))
[Counter({'111': 100})]
[Counter({'111': 100})]

And we are done! We have effectively performed a CNOT operation on our desired target qubits by using only the global interaction of the system as the building block Hamiltonian, together with single-qubit rotations. Going through the trouble of decomposing a single digital gate into its Ising Hamiltonian is certainly not very practical, but it serves as a proof of principle for the potential of this technique to represent universal quantum computation. In the next example, we will see it applied to the digital-analog Quantum Fourier Transform.

Technical details on the DAQC transformation

  • The mapping between target generator and final circuit is performed by solving a linear system of size \(n(n-1)\) where \(n\) is the number of qubits, so it can be computed efficiently (i.e., with a polynomial cost in the number of qubits).
  • The linear system to be solved is actually not invertible for \(n=4\) qubits. This is very specific edge case requiring a workaround, that is currently not yet implemented.
  • As mentioned, the final circuit has at most \(n(n-1)\) slices, so there is at most a polynomial overhead in circuit depth.

Finally, and most important to its usage:

  • The target Hamiltonian should be sufficiently represented in the building block Hamiltonian.

To illustrate this point, consider the following target and build Hamiltonians:

# Interaction between qubits 0 and 1
gen_target = 1.0 * (Z(0) @ Z(1))

# Fixed interaction between qubits 1 and 2, and customizable between 0 and 1
def gen_build(g_int):
    return g_int * (Z(0) @ Z(1)) + 1.0 * (Z(1) @ Z(2))

And now we perform the DAQC transform by setting g_int = 1.0, matching the target Hamiltonian:

transformed_ising = qd.daqc_transform(
    n_qubits = 3,
    gen_target = gen_target,
    t_f = 1.0,
    gen_build = gen_build(g_int = 1.0),
)

# display(transformed_ising)
%3 cluster_8a03c5acc161412ea9333562ff293dc1 cluster_36fd1b9f590343c4ab43eeab8d46a4fb f441becb067a4b3ba7c55db8780949e7 0 98cc3f7634ae45969a449781eeba8d4d X f441becb067a4b3ba7c55db8780949e7--98cc3f7634ae45969a449781eeba8d4d 986f7a985b354a1e99add2c355070b28 1 4e5a29f6f4e4433bbd009234ee229d04 HamEvo 98cc3f7634ae45969a449781eeba8d4d--4e5a29f6f4e4433bbd009234ee229d04 3f34964211d54ae1b46ce23c1dcab44b X 4e5a29f6f4e4433bbd009234ee229d04--3f34964211d54ae1b46ce23c1dcab44b e128d39e95b44084bab7210f7d204a67 3f34964211d54ae1b46ce23c1dcab44b--e128d39e95b44084bab7210f7d204a67 632dd032d64f4b7ba25ff3bb2ba810b2 HamEvo e128d39e95b44084bab7210f7d204a67--632dd032d64f4b7ba25ff3bb2ba810b2 1afc05a6684648c5b1d5275e6c4bc253 632dd032d64f4b7ba25ff3bb2ba810b2--1afc05a6684648c5b1d5275e6c4bc253 dbaf937ae2324b088c77a3a6e3dc124a 1afc05a6684648c5b1d5275e6c4bc253--dbaf937ae2324b088c77a3a6e3dc124a dac1652dab7542df83c7e5e37774d339 793e8435dbdc4d69bdfb3bdd289fcc46 986f7a985b354a1e99add2c355070b28--793e8435dbdc4d69bdfb3bdd289fcc46 218c841b551e4405a8126cd5e87d4167 2 402dc16ebb2b4791928b58ec76e3d8e3 t = -0.500 793e8435dbdc4d69bdfb3bdd289fcc46--402dc16ebb2b4791928b58ec76e3d8e3 022c209a2e94423c9801b50aee1560e3 402dc16ebb2b4791928b58ec76e3d8e3--022c209a2e94423c9801b50aee1560e3 4eb863ecb0f3443eba130a5c301719de X 022c209a2e94423c9801b50aee1560e3--4eb863ecb0f3443eba130a5c301719de ca74565f81c34078aa956e5cd5892e06 t = -0.500 4eb863ecb0f3443eba130a5c301719de--ca74565f81c34078aa956e5cd5892e06 5856b89ba5964e5aa70d2070e4465965 X ca74565f81c34078aa956e5cd5892e06--5856b89ba5964e5aa70d2070e4465965 5856b89ba5964e5aa70d2070e4465965--dac1652dab7542df83c7e5e37774d339 bb2fc803d14847d4a4fc1db455550e15 67412d4596704002b43227a4eba7530e X 218c841b551e4405a8126cd5e87d4167--67412d4596704002b43227a4eba7530e 401b979418ff45559fe5d91eb587febe 67412d4596704002b43227a4eba7530e--401b979418ff45559fe5d91eb587febe dfd5771601f4422fb808c5945342885b X 401b979418ff45559fe5d91eb587febe--dfd5771601f4422fb808c5945342885b d78f3b5717954904b4bb728dc064f6b5 X dfd5771601f4422fb808c5945342885b--d78f3b5717954904b4bb728dc064f6b5 adae1c5d1cde416aab3d8a87b7808659 d78f3b5717954904b4bb728dc064f6b5--adae1c5d1cde416aab3d8a87b7808659 096663d28d334fdbb00807d52e9f5999 X adae1c5d1cde416aab3d8a87b7808659--096663d28d334fdbb00807d52e9f5999 096663d28d334fdbb00807d52e9f5999--bb2fc803d14847d4a4fc1db455550e15

And we get the transformed circuit. What if our build Hamiltonian has a very weak interaction between qubits 0 and 1?

transformed_ising = qd.daqc_transform(
    n_qubits = 3,
    gen_target = gen_target,
    t_f = 1.0,
    gen_build = gen_build(g_int = 0.001),
)

# display(transformed_ising)
%3 cluster_9dffe4902741438c99af414315c80e29 cluster_40709e7d56174ef39bcc30dd499c3b47 f3973a170f084055b05fac20718ed42f 0 8b685d235c1d4f15b3ae38c466429fc3 X f3973a170f084055b05fac20718ed42f--8b685d235c1d4f15b3ae38c466429fc3 949b6c15c9294f918fefb4540089302e 1 8cb6407b416d4d45b8fdb33d81a5d734 HamEvo 8b685d235c1d4f15b3ae38c466429fc3--8cb6407b416d4d45b8fdb33d81a5d734 8710a1fcdb7d423485d85a7d0e4a1a1d X 8cb6407b416d4d45b8fdb33d81a5d734--8710a1fcdb7d423485d85a7d0e4a1a1d d502c4d6af3f4b55834f5bfdb7e93690 8710a1fcdb7d423485d85a7d0e4a1a1d--d502c4d6af3f4b55834f5bfdb7e93690 ab7e1ca9c24049019fa0273a3df1e879 HamEvo d502c4d6af3f4b55834f5bfdb7e93690--ab7e1ca9c24049019fa0273a3df1e879 1b4a578022e44dd1a949c258548517d4 ab7e1ca9c24049019fa0273a3df1e879--1b4a578022e44dd1a949c258548517d4 47eb1f0565124f8b9dd9c6f3033f7e28 1b4a578022e44dd1a949c258548517d4--47eb1f0565124f8b9dd9c6f3033f7e28 36b6bf50da5540009c3c9cd24774bb8f c8fcd9b41e6541a49036ccec99c53c25 949b6c15c9294f918fefb4540089302e--c8fcd9b41e6541a49036ccec99c53c25 0a16ba225a64497cb784ea80b5a8cb2e 2 ea3f26a92c1a4c13875bb02f75994c2d t = -500.000000000000 c8fcd9b41e6541a49036ccec99c53c25--ea3f26a92c1a4c13875bb02f75994c2d 12c2f1e4be3c4c8e9e11b8d05043bcbc ea3f26a92c1a4c13875bb02f75994c2d--12c2f1e4be3c4c8e9e11b8d05043bcbc e4cba8f6a01d4acf910a3077efa3b8d4 X 12c2f1e4be3c4c8e9e11b8d05043bcbc--e4cba8f6a01d4acf910a3077efa3b8d4 0ea33fdb18bb4c48b4217224ca2faa4e t = -500.000000000000 e4cba8f6a01d4acf910a3077efa3b8d4--0ea33fdb18bb4c48b4217224ca2faa4e bbe9b2ca2ea44af68f3cb7dcc14a48d6 X 0ea33fdb18bb4c48b4217224ca2faa4e--bbe9b2ca2ea44af68f3cb7dcc14a48d6 bbe9b2ca2ea44af68f3cb7dcc14a48d6--36b6bf50da5540009c3c9cd24774bb8f a3fd7f47944d495391e9eff3f23bd56d 030bcbcdad1f4c21b9ace3b120877ea9 X 0a16ba225a64497cb784ea80b5a8cb2e--030bcbcdad1f4c21b9ace3b120877ea9 35fa1b29720d400888ff3855cc0630bc 030bcbcdad1f4c21b9ace3b120877ea9--35fa1b29720d400888ff3855cc0630bc 3d6d26f19a174b46bcd26c8fe7bfe34e X 35fa1b29720d400888ff3855cc0630bc--3d6d26f19a174b46bcd26c8fe7bfe34e 3130ff5082c24c59ba088c1f1f82e719 X 3d6d26f19a174b46bcd26c8fe7bfe34e--3130ff5082c24c59ba088c1f1f82e719 753fcda0af644e5482a6e63f886343b4 3130ff5082c24c59ba088c1f1f82e719--753fcda0af644e5482a6e63f886343b4 b747541e7db24b2d80008abef87590ca X 753fcda0af644e5482a6e63f886343b4--b747541e7db24b2d80008abef87590ca b747541e7db24b2d80008abef87590ca--a3fd7f47944d495391e9eff3f23bd56d

As we can see, to represent the same interaction between 0 and 1, the slices using the build Hamiltonian need to evolve for much longer, since the target interaction is not sufficiently represented in the building block Hamiltonian.

In the limit where that interaction is not present at all, the transform will not work:

try:
    transformed_ising = qd.daqc_transform(
        n_qubits = 3,
        gen_target = gen_target,
        t_f = 1.0,
        gen_build = gen_build(g_int = 0.0),
    )
except ValueError as error:
    print("Error:", error)
Error: Incompatible interactions between target and build Hamiltonians.

References