Skip to content

CNOT with interacting qubits

Digital-analog quantum computing focuses on using single qubit digital gates combined with more complex and device-dependent analog interactions to represent quantum programs. This paradigm has been shown to be universal for quantum computation1. 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.

This tutorial will exemplify the DAQC transformation starting with the representation of a simple digital CNOT using the universality of the Ising Hamiltonian2.

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
from qadence import chain, sample, product_state

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 = chain(H(1), CPHASE(0, 1, phi), H(1))

init_state = product_state("10")
sample from CNOT gate and 100 shots = [Counter({'11': 100})]
sample from decomposed CNOT gate and 100 shots = [Counter({'11': 100})]

The CPHASE matrix is 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 the number operator \(N_i = \frac{1}{2}(I_i-Z_i)=\hat{n}_i\) is used, leading to an Ising-like interaction \(\hat{n}_i\hat{n}_j\) realisable in neutral-atom systems. Let's rebuild the CNOT using this evolution.

from qadence import kron, block_to_tensor

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

# Exponentiating and time-evolving the Hamiltonian until t=phi.
cphase_evo = HamEvo(h_cphase, phi)

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

Now that the CPHASE generator is checked, it can be applied to the CNOT:

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

# Initialize state to check CNOTs sample outcomes.
init_state = product_state("10")
sample cnot_gate = [Counter({'11': 100})]
sample cnot_evo = [Counter({'11': 100})]

Thus, a CNOT gate can be created by combining a few single-qubit gates together with a two-qubit Ising interaction between the control and the target qubit which is the essence of the Ising transform proposed in the seminal DAQC paper2 for \(ZZ\) interactions. In Qadence, both \(ZZ\) and \(NN\) interactions are supported.

CNOT in an interacting system of three qubits

Consider a simple experimental setup with \(n=3\) interacting qubits laid out in a triangular grid. For the sake of simplicity, all qubits interact with each other with an \(NN\)-Ising interaction of constant strength \(g_\text{int}\). The Hamiltonian for the system can be written by summing interaction terms 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 in Qadence:

from qadence import add, kron
n_qubits = 3

# Interaction strength.
g_int = 1.0

# Build a list of interactions.
interaction_list = []
for i in range(n_qubits):
    for j in range(i):
        interaction_list.append(g_int * kron(N(i), N(j)))

h_sys = add(*interaction_list)
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 qubits can not be isolated one from another. The options are:

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

To perform a fully digital CNOT(0,1), the interacting control on qubit 0 and target on qubit 1 must be isolated from the third one to implement the gate directly. While this can be achieved for a three-qubit system, it becomes experimentally untractable when scaling the qubit count.

However, this is not the case within the digital-analog paradigm. In fact, the two qubit Ising interaction required for the CNOT can be represented with a combination of the global system Hamiltonian and a specific set of single-qubit rotations. Full details about this transformation are to be found in the DAQC paper2 but a more succint yet in-depth description takes place in the next section. It is conveniently available in Qadence by calling the daqc_transform function.

In the most general sense, the daqc_transform function will return a circuit that represents the evolution of a target Hamiltonian \(\mathcal{H}_\text{target}\) (here the unitary of the gate) until a specified time \(t_f\) by using only the evolution of a build Hamiltonian \(\mathcal{H}_\text{build}\) (here \(\mathcal{H}_\text{sys}\)) together with local \(X\)-gates. In Qadence, daqc_transform is applicable for \(\mathcal{H}_\text{target}\) and \(\mathcal{H}_\text{build}\) composed only of \(ZZ\)- or \(NN\)-interactions. These generators are parsed by the daqc_transform function and the appropriate type is automatically determined together with the appropriate single-qubit detunings and global phases.

Let's apply it for the CNOT implementation:

from qadence import daqc_transform, Strategy

# Settings for the target CNOT operation
i = 0  # Control qubit
j = 1  # Target qubit
k = 2  # The extra qubit

# Define the target CNOT operation
# by composing with identity on the extra qubit.
cnot_target = kron(CNOT(i, j), I(k))

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

# Transforming the two-qubit Ising interaction using only our system Hamiltonian
transformed_ising = 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=Strategy.SDAQC,   # Currently only sDAQC is implemented
    ignore_global_phases=False  # Global phases from mapping between Z and N
)

# display(transformed_ising)
%3 cluster_cd5a91b7052547b2a71a7e77bd275fbb cluster_f93db6c507164943a3532ab8f8add187 cluster_5a003eb3b2ce479f96f5841a851533cc cluster_8291819387e34195a63d800e9a5aaa8e cluster_db07f13187394db0ae31d5eeb3e8b3f0 cluster_5ed9571bdb8845ef8b4b7f98fcd436a3 cluster_1f7fbd3130ca4b65be4a62bfd88e355b 670577b461414242866dd723e3d9a0ec 0 d0109edef03b4dc4b3f8e6ae7ade1af6 HamEvo 670577b461414242866dd723e3d9a0ec--d0109edef03b4dc4b3f8e6ae7ade1af6 5644ef717cf34673890dd59ee4bd9d21 1 44699ef68fbf4ca3a7d7994e48ba84fa HamEvo d0109edef03b4dc4b3f8e6ae7ade1af6--44699ef68fbf4ca3a7d7994e48ba84fa cc6e0c4c43984dccaaa5b3dfaa1b3857 HamEvo 44699ef68fbf4ca3a7d7994e48ba84fa--cc6e0c4c43984dccaaa5b3dfaa1b3857 c6f4f6e0dbc04adcaf52a2d022c20040 X cc6e0c4c43984dccaaa5b3dfaa1b3857--c6f4f6e0dbc04adcaf52a2d022c20040 26a925fac1c3433bb1a4d73290ee7ed6 HamEvo c6f4f6e0dbc04adcaf52a2d022c20040--26a925fac1c3433bb1a4d73290ee7ed6 3633d33f9d194bd98dceffa2f34d04d8 HamEvo 26a925fac1c3433bb1a4d73290ee7ed6--3633d33f9d194bd98dceffa2f34d04d8 e2e587f9290a45639625a8967788987e X 3633d33f9d194bd98dceffa2f34d04d8--e2e587f9290a45639625a8967788987e ac8c4b4895e244d6b05c7b962164f0a5 e2e587f9290a45639625a8967788987e--ac8c4b4895e244d6b05c7b962164f0a5 9bd0dac3b5fe440e87b08e5535c66deb HamEvo ac8c4b4895e244d6b05c7b962164f0a5--9bd0dac3b5fe440e87b08e5535c66deb 87f9c863211142aeb77b4705369b84eb HamEvo 9bd0dac3b5fe440e87b08e5535c66deb--87f9c863211142aeb77b4705369b84eb 289d6e621b484cf6b7d1fa1e32915022 87f9c863211142aeb77b4705369b84eb--289d6e621b484cf6b7d1fa1e32915022 34bd6d7fafe14b689128ae982abf90a4 289d6e621b484cf6b7d1fa1e32915022--34bd6d7fafe14b689128ae982abf90a4 2d93b4edd83d4d81b3f3002b1ed2d9ca d9d0d19d2e2e42daadc90516256db87c t = -3.142 5644ef717cf34673890dd59ee4bd9d21--d9d0d19d2e2e42daadc90516256db87c 4dda412525104e169456b9a69d899883 2 61a71ce2e4cb4dee9e1ad3f6eceff493 t = 3.142 d9d0d19d2e2e42daadc90516256db87c--61a71ce2e4cb4dee9e1ad3f6eceff493 9a01abcb415d4fef805d3ffd07a41ca5 t = -3.142 61a71ce2e4cb4dee9e1ad3f6eceff493--9a01abcb415d4fef805d3ffd07a41ca5 335c2dfd383d410bb5310fc5cfdf4e7e 9a01abcb415d4fef805d3ffd07a41ca5--335c2dfd383d410bb5310fc5cfdf4e7e 8ade2ce9a02d4aa586f55f29d281b15a t = 1.571 335c2dfd383d410bb5310fc5cfdf4e7e--8ade2ce9a02d4aa586f55f29d281b15a 27bc75de34164f878728f5a87f6cf75c t = 1.571 8ade2ce9a02d4aa586f55f29d281b15a--27bc75de34164f878728f5a87f6cf75c 60cbce39edcd4da59d846daf0fff1009 27bc75de34164f878728f5a87f6cf75c--60cbce39edcd4da59d846daf0fff1009 ee589dd8e42d4db09faaf0cf6f0d1566 X 60cbce39edcd4da59d846daf0fff1009--ee589dd8e42d4db09faaf0cf6f0d1566 c5416ac2e0d24e5988235ab079bdc33f t = 1.571 ee589dd8e42d4db09faaf0cf6f0d1566--c5416ac2e0d24e5988235ab079bdc33f a89b0787ed7d40e096550452ffffd27b t = 1.571 c5416ac2e0d24e5988235ab079bdc33f--a89b0787ed7d40e096550452ffffd27b dfef32f4c7ec4aed93ab2f6fdbd72a0d X a89b0787ed7d40e096550452ffffd27b--dfef32f4c7ec4aed93ab2f6fdbd72a0d dfef32f4c7ec4aed93ab2f6fdbd72a0d--2d93b4edd83d4d81b3f3002b1ed2d9ca 106b383274ad45a6b88345520cfdd448 700a953ea3684b649b727fb169b7a73a 4dda412525104e169456b9a69d899883--700a953ea3684b649b727fb169b7a73a 9cf0734ef5114792bb836855436cce4a 700a953ea3684b649b727fb169b7a73a--9cf0734ef5114792bb836855436cce4a 3ed4da80fc1f4cf89a515b64f46d0f13 9cf0734ef5114792bb836855436cce4a--3ed4da80fc1f4cf89a515b64f46d0f13 e2f6e72488a0423aa52e45fa511a3439 X 3ed4da80fc1f4cf89a515b64f46d0f13--e2f6e72488a0423aa52e45fa511a3439 f02331dc7d1d4d18abf0573060e2c69f e2f6e72488a0423aa52e45fa511a3439--f02331dc7d1d4d18abf0573060e2c69f 25883870b53a413a929ccf86c671bdbc f02331dc7d1d4d18abf0573060e2c69f--25883870b53a413a929ccf86c671bdbc b7e75598e4fd4617a0f7bce72cfd0c97 X 25883870b53a413a929ccf86c671bdbc--b7e75598e4fd4617a0f7bce72cfd0c97 77897eb33c0042cc8f09135b18bbd8d5 X b7e75598e4fd4617a0f7bce72cfd0c97--77897eb33c0042cc8f09135b18bbd8d5 e85acc615f91422fb1d8673d6b62556e 77897eb33c0042cc8f09135b18bbd8d5--e85acc615f91422fb1d8673d6b62556e 643331d5939340caa481ea9b5f01cd0a e85acc615f91422fb1d8673d6b62556e--643331d5939340caa481ea9b5f01cd0a 0f887a178d6e455eb4dd387b1128bd75 X 643331d5939340caa481ea9b5f01cd0a--0f887a178d6e455eb4dd387b1128bd75 0f887a178d6e455eb4dd387b1128bd75--106b383274ad45a6b88345520cfdd448

The output circuit displays three groups of system Hamiltonian evolutions which account for global-phases and single-qubit detunings related to the mapping between the \(Z\) and \(N\) operators. Optionally, global phases can be ignored.

In general, the mapping of a \(n\)-qubit Ising Hamiltonian to another 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 when using the step-wise DAQC strategy (Strategy.SDAQC) available in Qadence. In banged DAQC (Strategy.BDAQC) the mapping is approximate, but easier to implement on a physical device with always-on interactions such as neutral-atom systems.

Just as before, the transformed Ising circuit can be checked to exactly recover the CPHASE gate:

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

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

# Check that it implements the CPHASE.
# Will fail if global phases are ignored.
cphase_matrix == cphase_evo_matrix : True

The CNOT gate can now finally be built:

from qadence import equivalent_state, run, sample

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

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

# Check we get an equivalent wavefunction
wf_cnot = run(n_qubits, block=cnot_target, state=init_state)
wf_daqc = run(n_qubits, block=cnot_daqc, state=init_state)

# Visualize the CNOT bit-flip in samples.
wf_cnot == wf_dacq : True
sample cnot_target = [Counter({'111': 100})]
sample cnot_dacq = [Counter({'111': 100})]

As one can see, a CNOT operation has been succesfully implemented on the desired target qubits by using only the global system as the building block Hamiltonian and single-qubit rotations. Decomposing a single digital gate into an Ising Hamiltonian serves as a proof of principle for the potential of this technique to represent universal quantum computation.

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 quadratic 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, exactly matching the target Hamiltonian:

transformed_ising = 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_d9451a8bcba84e819f420b13fad2864e cluster_5f3e29d339f84a7bb54830783053c3ea b7714f79e388491cb1cecfd2312b41fe 0 e74a2801ddce4072a451df775a6130fa X b7714f79e388491cb1cecfd2312b41fe--e74a2801ddce4072a451df775a6130fa 5fcdefaf52da44098048039482659b06 1 7627bf045b3842d3a70aa3fa810a8611 HamEvo e74a2801ddce4072a451df775a6130fa--7627bf045b3842d3a70aa3fa810a8611 7f7620f7f70347649424468db9ca94c8 X 7627bf045b3842d3a70aa3fa810a8611--7f7620f7f70347649424468db9ca94c8 d7411749f1834ec28022bec5b81e8a42 7f7620f7f70347649424468db9ca94c8--d7411749f1834ec28022bec5b81e8a42 6ccba372ff474dc998f60ef0c8ce7f9d HamEvo d7411749f1834ec28022bec5b81e8a42--6ccba372ff474dc998f60ef0c8ce7f9d 8d39b4b6ad5e4fa68b8432f94343d99e 6ccba372ff474dc998f60ef0c8ce7f9d--8d39b4b6ad5e4fa68b8432f94343d99e 5ac2942800614c31a66d48a0350ebabb 8d39b4b6ad5e4fa68b8432f94343d99e--5ac2942800614c31a66d48a0350ebabb 8da78f9c4ccf4099adc1e2ddc5604c86 6b8f953f079c48d59f36feabd5e246a0 5fcdefaf52da44098048039482659b06--6b8f953f079c48d59f36feabd5e246a0 af692a8c11594f67a54c1b5e76e7dc99 2 0a654114634744e39f88cc6f9026d472 t = -0.500 6b8f953f079c48d59f36feabd5e246a0--0a654114634744e39f88cc6f9026d472 f7396331328646eca5de3e81a4c8d21d 0a654114634744e39f88cc6f9026d472--f7396331328646eca5de3e81a4c8d21d 93129dd647d242e3a4c0ae520028cd3f X f7396331328646eca5de3e81a4c8d21d--93129dd647d242e3a4c0ae520028cd3f 47989723642d4031bc7ef56e760922d1 t = -0.500 93129dd647d242e3a4c0ae520028cd3f--47989723642d4031bc7ef56e760922d1 5d358420201e4ed79b28b2fe2b2262fe X 47989723642d4031bc7ef56e760922d1--5d358420201e4ed79b28b2fe2b2262fe 5d358420201e4ed79b28b2fe2b2262fe--8da78f9c4ccf4099adc1e2ddc5604c86 d145faad2d084df59287716af877c28a 683935a0fa5741bd917d9094237f88f1 X af692a8c11594f67a54c1b5e76e7dc99--683935a0fa5741bd917d9094237f88f1 f4ac20c808714f088fb3dbdfc18011e3 683935a0fa5741bd917d9094237f88f1--f4ac20c808714f088fb3dbdfc18011e3 0e263847658e43b6b06ce49f2c404e65 X f4ac20c808714f088fb3dbdfc18011e3--0e263847658e43b6b06ce49f2c404e65 bd38e15a14cc4e1d9f9d0132963d04ad X 0e263847658e43b6b06ce49f2c404e65--bd38e15a14cc4e1d9f9d0132963d04ad 67499f152db04395a8dadc59976cdab2 bd38e15a14cc4e1d9f9d0132963d04ad--67499f152db04395a8dadc59976cdab2 9bb21266fefd4f10a029c67a038b7d72 X 67499f152db04395a8dadc59976cdab2--9bb21266fefd4f10a029c67a038b7d72 9bb21266fefd4f10a029c67a038b7d72--d145faad2d084df59287716af877c28a

Now, if the interaction between qubits 0 and 1 is weakened in the build Hamiltonian:

transformed_ising = 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_e6ae668bfa4a4dce80ca55f8baca9d49 cluster_3f74fd4e17af43d586f49fea511164e1 46956a9de5d44d2fb0133b6be2515ffa 0 0ed30c3094134fe9abae18f285670e86 X 46956a9de5d44d2fb0133b6be2515ffa--0ed30c3094134fe9abae18f285670e86 b867fffda1634d9188bad022aadc099e 1 c7b7a0eb716648eb9e02c5bd9c7f9737 HamEvo 0ed30c3094134fe9abae18f285670e86--c7b7a0eb716648eb9e02c5bd9c7f9737 49cba16429f342449cdb5efac05a0dfb X c7b7a0eb716648eb9e02c5bd9c7f9737--49cba16429f342449cdb5efac05a0dfb 00f2bff416c74b1e9610d6dd1d2d9d1e 49cba16429f342449cdb5efac05a0dfb--00f2bff416c74b1e9610d6dd1d2d9d1e 336981ac02334aa9b42f4e07423f1215 HamEvo 00f2bff416c74b1e9610d6dd1d2d9d1e--336981ac02334aa9b42f4e07423f1215 40fbcf7705f84c919941e9db05b2112d 336981ac02334aa9b42f4e07423f1215--40fbcf7705f84c919941e9db05b2112d 0ceec60762ed4de681502eb163334683 40fbcf7705f84c919941e9db05b2112d--0ceec60762ed4de681502eb163334683 29c3738817914612ba13bf7f4a010af7 249e973a609a42bc9b6a5d09ef42e5f8 b867fffda1634d9188bad022aadc099e--249e973a609a42bc9b6a5d09ef42e5f8 60e409f3267f401499169baaa845c6a9 2 c12bda8e96004ea0a724bd4e8fb31f67 t = -500.000000000000 249e973a609a42bc9b6a5d09ef42e5f8--c12bda8e96004ea0a724bd4e8fb31f67 f394f64e8cfe4b9c92639d7635c97e36 c12bda8e96004ea0a724bd4e8fb31f67--f394f64e8cfe4b9c92639d7635c97e36 697e83f36d474c72aee7269bc1a56af0 X f394f64e8cfe4b9c92639d7635c97e36--697e83f36d474c72aee7269bc1a56af0 55c8fffb48e548b5938d928a4e02c1be t = -500.000000000000 697e83f36d474c72aee7269bc1a56af0--55c8fffb48e548b5938d928a4e02c1be cd8472b392b14692a5f4887a263a1d5e X 55c8fffb48e548b5938d928a4e02c1be--cd8472b392b14692a5f4887a263a1d5e cd8472b392b14692a5f4887a263a1d5e--29c3738817914612ba13bf7f4a010af7 49bd214bb30346b39b0832b4eae55a80 31f6331ea6284d28bb46ccd4f8568965 X 60e409f3267f401499169baaa845c6a9--31f6331ea6284d28bb46ccd4f8568965 b42bf4af45a04fe486c8c151fbbfa0d4 31f6331ea6284d28bb46ccd4f8568965--b42bf4af45a04fe486c8c151fbbfa0d4 69ec64711cb84fe69251304f37c0ddb8 X b42bf4af45a04fe486c8c151fbbfa0d4--69ec64711cb84fe69251304f37c0ddb8 9c90a0b3d9f24f9b81fcfd67ecd21cbe X 69ec64711cb84fe69251304f37c0ddb8--9c90a0b3d9f24f9b81fcfd67ecd21cbe 6ab2a989845c49c78b89938ba7960168 9c90a0b3d9f24f9b81fcfd67ecd21cbe--6ab2a989845c49c78b89938ba7960168 67b1dd37bf9a40c1bdd1cd5e8f7ad801 X 6ab2a989845c49c78b89938ba7960168--67b1dd37bf9a40c1bdd1cd5e8f7ad801 67b1dd37bf9a40c1bdd1cd5e8f7ad801--49bd214bb30346b39b0832b4eae55a80

The times slices using the build Hamiltonian need now to evolve for much longer to represent the same interaction since it is not sufficiently represented in the building block Hamiltonian.

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

try:
    transformed_ising = 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