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, PI

n_qubits = 2

# CNOT gate
cnot_gate = CNOT(0, 1)

# CNOT decomposed
phi = PI
cnot_decomp = chain(H(1), CPHASE(0, 1, phi), H(1))

init_state = product_state("10")
sample from CNOT gate and 100 shots = [OrderedCounter({'11': 100})]
sample from decomposed CNOT gate and 100 shots = [OrderedCounter({'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 = [OrderedCounter({'11': 100})]
sample cnot_evo = [OrderedCounter({'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.000] 
   └── KronBlock(0,1)
       ├── N(1)
       └── N(0)
├── [mul: 1.000] 
   └── KronBlock(0,2)
       ├── N(2)
       └── N(0)
└── [mul: 1.000] 
    └── 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=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_1d5d2138d1d543adaeb99d0313beea1b cluster_a225c24f5f464c10b09cb7939a95ece0 cluster_37957e3735de45acba63fb7be85f090f cluster_2e96b58b4046425cb77a832e3720245a cluster_94a3096d29e34f188dbdf9a9d7b9de0e cluster_8d2751f3844e4deb81571982cad6ee96 cluster_666607dbcd514a64ae3133753c6807e7 e300551316004d58be8df0cd7c9ad2e1 0 5c08860268ea4eb3bcfabfe0f1282485 HamEvo e300551316004d58be8df0cd7c9ad2e1--5c08860268ea4eb3bcfabfe0f1282485 07dc296a7c3648dabd1a313fbb7f3d6e 1 de2d95ca22e549ecbd65bb9ef4241b45 HamEvo 5c08860268ea4eb3bcfabfe0f1282485--de2d95ca22e549ecbd65bb9ef4241b45 d72224757c3f462b980c8150c9e1883a HamEvo de2d95ca22e549ecbd65bb9ef4241b45--d72224757c3f462b980c8150c9e1883a 70b8c010cf424953b8dfa64a0d24b728 X d72224757c3f462b980c8150c9e1883a--70b8c010cf424953b8dfa64a0d24b728 bdb8e4dd65df49508d96df72c9d2cb47 HamEvo 70b8c010cf424953b8dfa64a0d24b728--bdb8e4dd65df49508d96df72c9d2cb47 277b4aea17544b4abf3a126cfefd40c9 HamEvo bdb8e4dd65df49508d96df72c9d2cb47--277b4aea17544b4abf3a126cfefd40c9 e542d8dec7fb4b5492ad148cf48f5f6e X 277b4aea17544b4abf3a126cfefd40c9--e542d8dec7fb4b5492ad148cf48f5f6e f8afd24fb8be4f31bc4404e534d0a0c1 e542d8dec7fb4b5492ad148cf48f5f6e--f8afd24fb8be4f31bc4404e534d0a0c1 f29589acf990405da3cd9820529f4faf HamEvo f8afd24fb8be4f31bc4404e534d0a0c1--f29589acf990405da3cd9820529f4faf 5afc52d2e94d4f7d8a8105bc06e5e1a8 HamEvo f29589acf990405da3cd9820529f4faf--5afc52d2e94d4f7d8a8105bc06e5e1a8 0fde83a64f324db48c956e7e20a6e110 5afc52d2e94d4f7d8a8105bc06e5e1a8--0fde83a64f324db48c956e7e20a6e110 fda10c752b7449869e79ae9364f84a97 0fde83a64f324db48c956e7e20a6e110--fda10c752b7449869e79ae9364f84a97 d9bcbd2d3d9f4452beff5208f0150d87 1328b9705ea246f99579b6b83926c7ca t = -3.14 07dc296a7c3648dabd1a313fbb7f3d6e--1328b9705ea246f99579b6b83926c7ca 910330d0c83549629b175126a1baeead 2 8fcdb96c0f3b4639bae91ff536fe55a9 t = 3.142 1328b9705ea246f99579b6b83926c7ca--8fcdb96c0f3b4639bae91ff536fe55a9 2340ef1d74f241729190c8112a0ec2e3 t = -3.14 8fcdb96c0f3b4639bae91ff536fe55a9--2340ef1d74f241729190c8112a0ec2e3 2a8fee59b3a94c8dbc67e472a9772d39 2340ef1d74f241729190c8112a0ec2e3--2a8fee59b3a94c8dbc67e472a9772d39 20184bdce28a4e5683c5f11266f7da33 t = 1.571 2a8fee59b3a94c8dbc67e472a9772d39--20184bdce28a4e5683c5f11266f7da33 a1ae59d89cc24ec3bdad8c9b750f4aff t = 1.571 20184bdce28a4e5683c5f11266f7da33--a1ae59d89cc24ec3bdad8c9b750f4aff 0f9b4d58f8464f389823479ca36af051 a1ae59d89cc24ec3bdad8c9b750f4aff--0f9b4d58f8464f389823479ca36af051 aa7f671e0ae74252bd388e30b7b9a937 X 0f9b4d58f8464f389823479ca36af051--aa7f671e0ae74252bd388e30b7b9a937 00bb15380b8448e79f6be6931edfeb67 t = 1.571 aa7f671e0ae74252bd388e30b7b9a937--00bb15380b8448e79f6be6931edfeb67 7f52a3034f714705a254b87a51bdc1b4 t = 1.571 00bb15380b8448e79f6be6931edfeb67--7f52a3034f714705a254b87a51bdc1b4 ffd252d073fc4f389486cadf675f0a68 X 7f52a3034f714705a254b87a51bdc1b4--ffd252d073fc4f389486cadf675f0a68 ffd252d073fc4f389486cadf675f0a68--d9bcbd2d3d9f4452beff5208f0150d87 20ca7ee283e54ce7b9fbd4bd277faf07 3e4f328da5f3467f836eb4dd8badbbb6 910330d0c83549629b175126a1baeead--3e4f328da5f3467f836eb4dd8badbbb6 e6cf11ae1df34dc3bdfd48124a632d30 3e4f328da5f3467f836eb4dd8badbbb6--e6cf11ae1df34dc3bdfd48124a632d30 07b9b2e12a5349f39e3db36ced1d7a10 e6cf11ae1df34dc3bdfd48124a632d30--07b9b2e12a5349f39e3db36ced1d7a10 bdaaa969df014dcb85a55a94393ab5d9 X 07b9b2e12a5349f39e3db36ced1d7a10--bdaaa969df014dcb85a55a94393ab5d9 8fe8b995856743e098f57970281cb949 bdaaa969df014dcb85a55a94393ab5d9--8fe8b995856743e098f57970281cb949 1a69780a8cb945f0ac07c494dac743f9 8fe8b995856743e098f57970281cb949--1a69780a8cb945f0ac07c494dac743f9 08c5ca4fde7b4630ac60134c6be9f53c X 1a69780a8cb945f0ac07c494dac743f9--08c5ca4fde7b4630ac60134c6be9f53c 904d291218e94dcabfccdbe7517712be X 08c5ca4fde7b4630ac60134c6be9f53c--904d291218e94dcabfccdbe7517712be f1003dada3db4abd92f28ef6f625944d 904d291218e94dcabfccdbe7517712be--f1003dada3db4abd92f28ef6f625944d 599176f9de52453aacfa6fa97c61ba03 f1003dada3db4abd92f28ef6f625944d--599176f9de52453aacfa6fa97c61ba03 6d1b9d2802a7472c96bc406c51a34171 X 599176f9de52453aacfa6fa97c61ba03--6d1b9d2802a7472c96bc406c51a34171 6d1b9d2802a7472c96bc406c51a34171--20ca7ee283e54ce7b9fbd4bd277faf07

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 = [OrderedCounter({'111': 100})]
sample cnot_dacq = [OrderedCounter({'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_59d93835c7fc4f1791e8e81bd88ad03d cluster_3ed40fba51bf475f98b510c1fb1315e0 aa0627e562b844498351adaf52a199e9 0 95cfef77efa649839fa3eb6da3b8ebfe X aa0627e562b844498351adaf52a199e9--95cfef77efa649839fa3eb6da3b8ebfe 8fcd2d5a059446aeba68066e722592d9 1 106d7ea5f9b24d29baaae6cd290f5dbb HamEvo 95cfef77efa649839fa3eb6da3b8ebfe--106d7ea5f9b24d29baaae6cd290f5dbb 71d91c8d865a44a9be6f5aebae0f56ac X 106d7ea5f9b24d29baaae6cd290f5dbb--71d91c8d865a44a9be6f5aebae0f56ac c6ad17db4f7e4e4baaa0036eaf78ede3 71d91c8d865a44a9be6f5aebae0f56ac--c6ad17db4f7e4e4baaa0036eaf78ede3 9e0f925d79b84e008c31c350831eebdf HamEvo c6ad17db4f7e4e4baaa0036eaf78ede3--9e0f925d79b84e008c31c350831eebdf 867f509244df4767a51dbb262aa7493e 9e0f925d79b84e008c31c350831eebdf--867f509244df4767a51dbb262aa7493e 6a4c2b86fe8148c7b20cca300964b555 867f509244df4767a51dbb262aa7493e--6a4c2b86fe8148c7b20cca300964b555 9f0258a934fc40daa2a3df09f1c753ab 90def885debc409a9ffd181c13be5887 8fcd2d5a059446aeba68066e722592d9--90def885debc409a9ffd181c13be5887 981b38bb66fe4071a7dcf656209deb34 2 72107203f6544606a1df6891f94177c3 t = -0.50 90def885debc409a9ffd181c13be5887--72107203f6544606a1df6891f94177c3 c57ac47b7813446686879dd16f0bbff0 72107203f6544606a1df6891f94177c3--c57ac47b7813446686879dd16f0bbff0 58e4ff80ae72405681d17aca3ffa6326 X c57ac47b7813446686879dd16f0bbff0--58e4ff80ae72405681d17aca3ffa6326 41498ee93ca948a4845f24b59c79f942 t = -0.50 58e4ff80ae72405681d17aca3ffa6326--41498ee93ca948a4845f24b59c79f942 cc3b5a7f4ab1402ea25340740e9e97d3 X 41498ee93ca948a4845f24b59c79f942--cc3b5a7f4ab1402ea25340740e9e97d3 cc3b5a7f4ab1402ea25340740e9e97d3--9f0258a934fc40daa2a3df09f1c753ab 33f7921c4b03437599d898ece7b7e07e b27b3fdb9c2549d28ce147a6480f4c53 X 981b38bb66fe4071a7dcf656209deb34--b27b3fdb9c2549d28ce147a6480f4c53 31b205a37cb44197913c52e84903821a b27b3fdb9c2549d28ce147a6480f4c53--31b205a37cb44197913c52e84903821a 5d43c79270164ef99c29ddf5202b5757 X 31b205a37cb44197913c52e84903821a--5d43c79270164ef99c29ddf5202b5757 de1ff4a344854b688c5597157decd03e X 5d43c79270164ef99c29ddf5202b5757--de1ff4a344854b688c5597157decd03e c63a020ddd504a8c95e630ceb58e0b14 de1ff4a344854b688c5597157decd03e--c63a020ddd504a8c95e630ceb58e0b14 0243cd4fbcbd4491a1ee8039c056209b X c63a020ddd504a8c95e630ceb58e0b14--0243cd4fbcbd4491a1ee8039c056209b 0243cd4fbcbd4491a1ee8039c056209b--33f7921c4b03437599d898ece7b7e07e

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_70e5446389c343a48d240336a8dbb3fe cluster_d3ffc5f4987a422eb0e5946ecc75a22b a2c8903bc7884e359d0a668adaba4ef2 0 0dfbc7ddf5e74ef48fa150cc31a91a9e X a2c8903bc7884e359d0a668adaba4ef2--0dfbc7ddf5e74ef48fa150cc31a91a9e c20b232f42d949ff8b5bb4aba359de20 1 e29c85ae4a094920be5a0fc1180be459 HamEvo 0dfbc7ddf5e74ef48fa150cc31a91a9e--e29c85ae4a094920be5a0fc1180be459 8f9deb0e447341aeba5c0979bb5265b1 X e29c85ae4a094920be5a0fc1180be459--8f9deb0e447341aeba5c0979bb5265b1 69cb5935a0ae4d61ba783e096fd9eca8 8f9deb0e447341aeba5c0979bb5265b1--69cb5935a0ae4d61ba783e096fd9eca8 c3df37fbc1a541019bd1a785ff051812 HamEvo 69cb5935a0ae4d61ba783e096fd9eca8--c3df37fbc1a541019bd1a785ff051812 320d1224eafb4ff1a3a16315a735a79a c3df37fbc1a541019bd1a785ff051812--320d1224eafb4ff1a3a16315a735a79a a00f90e65f2542b5afc2acaa3ab311f1 320d1224eafb4ff1a3a16315a735a79a--a00f90e65f2542b5afc2acaa3ab311f1 620b1dbb8cac4d7aa0dd411f859e5b2f 6c2e0849b27c4f5b8ac94cdc890c4de6 c20b232f42d949ff8b5bb4aba359de20--6c2e0849b27c4f5b8ac94cdc890c4de6 95a1e7f8314e4bf98c4a6ebf4d42a482 2 5a079c5106ae45178600d7b72a7f68ed t = -500. 6c2e0849b27c4f5b8ac94cdc890c4de6--5a079c5106ae45178600d7b72a7f68ed ff358ad4f627427892531ce57418e31d 5a079c5106ae45178600d7b72a7f68ed--ff358ad4f627427892531ce57418e31d fbc255cc75d84278bf4e33c93dcef0d8 X ff358ad4f627427892531ce57418e31d--fbc255cc75d84278bf4e33c93dcef0d8 c286fa664d6c4722b3820b68581b0390 t = -500. fbc255cc75d84278bf4e33c93dcef0d8--c286fa664d6c4722b3820b68581b0390 ea05c2d05c9047a8a20ba23358f63fc9 X c286fa664d6c4722b3820b68581b0390--ea05c2d05c9047a8a20ba23358f63fc9 ea05c2d05c9047a8a20ba23358f63fc9--620b1dbb8cac4d7aa0dd411f859e5b2f 5b50cc5f39e143798c71d4f53bd950d8 4dc2721ed6fe4942b337c633f6e6f8bb X 95a1e7f8314e4bf98c4a6ebf4d42a482--4dc2721ed6fe4942b337c633f6e6f8bb 61abae7bd93046989b688a48ea80f1e8 4dc2721ed6fe4942b337c633f6e6f8bb--61abae7bd93046989b688a48ea80f1e8 f254a324653f4123a62b085d83207a90 X 61abae7bd93046989b688a48ea80f1e8--f254a324653f4123a62b085d83207a90 bd5e95e0a5d44f4886d47a02694ea2de X f254a324653f4123a62b085d83207a90--bd5e95e0a5d44f4886d47a02694ea2de 6ccfd3902c374f83a78d0dc523e21aa2 bd5e95e0a5d44f4886d47a02694ea2de--6ccfd3902c374f83a78d0dc523e21aa2 b6fa419344094df3aadd80ef74b43a79 X 6ccfd3902c374f83a78d0dc523e21aa2--b6fa419344094df3aadd80ef74b43a79 b6fa419344094df3aadd80ef74b43a79--5b50cc5f39e143798c71d4f53bd950d8

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