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 = [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=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_5c29f22d592e4060a7f41b32519b826c cluster_6b62e383dd124805b7a119fa79474f14 cluster_baf6262eafba4825a5afa8053e201e86 cluster_45e33178a73641bbab6a6e468bbd01ea cluster_792acbe3adec482c9b00f31c32d564a2 cluster_558faad9f8834405afa7906309c0c799 cluster_4250799b44244277bee0d689fd2b1caa 3e470c4ec84e4a78a2e6c271797ca292 0 881a6e79b5fa4ee69bfc27af2267a30a HamEvo 3e470c4ec84e4a78a2e6c271797ca292--881a6e79b5fa4ee69bfc27af2267a30a c161fcb8a95a4d2c9adca06bd8c925c2 1 e76abe3e387b47638be07c706f6a98ad HamEvo 881a6e79b5fa4ee69bfc27af2267a30a--e76abe3e387b47638be07c706f6a98ad 0d5ae5aaf001466989aa4be1c0c5477c HamEvo e76abe3e387b47638be07c706f6a98ad--0d5ae5aaf001466989aa4be1c0c5477c cc8944d7bdff4680902531f570b23cd2 X 0d5ae5aaf001466989aa4be1c0c5477c--cc8944d7bdff4680902531f570b23cd2 f093e25902734f7589e4adb4983d17cb HamEvo cc8944d7bdff4680902531f570b23cd2--f093e25902734f7589e4adb4983d17cb 604e86883ad047acaac70f35940a6220 HamEvo f093e25902734f7589e4adb4983d17cb--604e86883ad047acaac70f35940a6220 b30889f1e26844c3ae118b215628ce01 X 604e86883ad047acaac70f35940a6220--b30889f1e26844c3ae118b215628ce01 2ebed55559bf471fbf98b6a20f68d33f b30889f1e26844c3ae118b215628ce01--2ebed55559bf471fbf98b6a20f68d33f 9ce2e58f7fc44f42b69906ffe500026c HamEvo 2ebed55559bf471fbf98b6a20f68d33f--9ce2e58f7fc44f42b69906ffe500026c 9007ae93581b47ac82dc3e9a3312f01d HamEvo 9ce2e58f7fc44f42b69906ffe500026c--9007ae93581b47ac82dc3e9a3312f01d 634b34f5814842c4b14a5b044f0867a4 9007ae93581b47ac82dc3e9a3312f01d--634b34f5814842c4b14a5b044f0867a4 94c378f1ed0f4b24a70d76eb2c611c0c 634b34f5814842c4b14a5b044f0867a4--94c378f1ed0f4b24a70d76eb2c611c0c 0f21048c89bc4b6cb26ad9d2d24cbba8 65e525f6090f4551989189b1579f9b22 t = -3.142 c161fcb8a95a4d2c9adca06bd8c925c2--65e525f6090f4551989189b1579f9b22 61f9e39a91b24eaab5efd49ff60fa1b5 2 441e6bdb8e354deaa638a88780b61e73 t = 3.142 65e525f6090f4551989189b1579f9b22--441e6bdb8e354deaa638a88780b61e73 b1b1f641fa804c8897e692cc2bb9867f t = -3.142 441e6bdb8e354deaa638a88780b61e73--b1b1f641fa804c8897e692cc2bb9867f 41dbf649da9d4318b256cbc076f982ea b1b1f641fa804c8897e692cc2bb9867f--41dbf649da9d4318b256cbc076f982ea 78ab4e3c9bfd419b8e07941982a71430 t = 1.571 41dbf649da9d4318b256cbc076f982ea--78ab4e3c9bfd419b8e07941982a71430 5546d1e2e49a4f5e834d6aa63b679ae7 t = 1.571 78ab4e3c9bfd419b8e07941982a71430--5546d1e2e49a4f5e834d6aa63b679ae7 5997ffc670ab42fd9f303b565db75a6d 5546d1e2e49a4f5e834d6aa63b679ae7--5997ffc670ab42fd9f303b565db75a6d c143add325994d5ba66ace6afbbbf618 X 5997ffc670ab42fd9f303b565db75a6d--c143add325994d5ba66ace6afbbbf618 2fcf11420f4f4fdc8267775a1ccf3a22 t = 1.571 c143add325994d5ba66ace6afbbbf618--2fcf11420f4f4fdc8267775a1ccf3a22 9a5d50f8e7d4464987281b4ebf006bc2 t = 1.571 2fcf11420f4f4fdc8267775a1ccf3a22--9a5d50f8e7d4464987281b4ebf006bc2 c954fe804d14423e8f8514c1a3b28b4e X 9a5d50f8e7d4464987281b4ebf006bc2--c954fe804d14423e8f8514c1a3b28b4e c954fe804d14423e8f8514c1a3b28b4e--0f21048c89bc4b6cb26ad9d2d24cbba8 ec12024d2e194a108c9cdf7deb589e0a 2ab514fd4dcf4490ba4298dc1cdd5f15 61f9e39a91b24eaab5efd49ff60fa1b5--2ab514fd4dcf4490ba4298dc1cdd5f15 5629745466b4431996b8a38a87d239da 2ab514fd4dcf4490ba4298dc1cdd5f15--5629745466b4431996b8a38a87d239da c582a31c3ea34bc89ca11ed0a0e6f12e 5629745466b4431996b8a38a87d239da--c582a31c3ea34bc89ca11ed0a0e6f12e 03d789c0d65845cbb7692185fb6e66e4 X c582a31c3ea34bc89ca11ed0a0e6f12e--03d789c0d65845cbb7692185fb6e66e4 d35b292cc9914f53870bf1fa10c4393f 03d789c0d65845cbb7692185fb6e66e4--d35b292cc9914f53870bf1fa10c4393f 6be6e849294a40c4bad9e979fc6bfdc1 d35b292cc9914f53870bf1fa10c4393f--6be6e849294a40c4bad9e979fc6bfdc1 c4b5658b7d784ff980d7e46651651690 X 6be6e849294a40c4bad9e979fc6bfdc1--c4b5658b7d784ff980d7e46651651690 f5b16d95dfde4f1bbe8c55fbe25cb07d X c4b5658b7d784ff980d7e46651651690--f5b16d95dfde4f1bbe8c55fbe25cb07d 0c8a4fb26e364476ab59aba7b984c4b7 f5b16d95dfde4f1bbe8c55fbe25cb07d--0c8a4fb26e364476ab59aba7b984c4b7 ea455f113e0b4855a85d47e8e77979ac 0c8a4fb26e364476ab59aba7b984c4b7--ea455f113e0b4855a85d47e8e77979ac 60251c00279b4910819a2b56963b250a X ea455f113e0b4855a85d47e8e77979ac--60251c00279b4910819a2b56963b250a 60251c00279b4910819a2b56963b250a--ec12024d2e194a108c9cdf7deb589e0a

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_9ab95869240d40258a381210c2480628 cluster_e1d6d7b0c3e5448595b16e51897a96d7 b9d9a0a118ef4cffb006b232263b2140 0 95218dbbb0c24c259eeec1ea8b4a74fc X b9d9a0a118ef4cffb006b232263b2140--95218dbbb0c24c259eeec1ea8b4a74fc 15ad7e97636e4ba78e4de8a49809c0ef 1 415a3959df3d419d83fedf945fde37f3 HamEvo 95218dbbb0c24c259eeec1ea8b4a74fc--415a3959df3d419d83fedf945fde37f3 6084d68336d8447191f5499b76f21d50 X 415a3959df3d419d83fedf945fde37f3--6084d68336d8447191f5499b76f21d50 2d0a9e7ee1be458cbb9f47bed42fbe62 6084d68336d8447191f5499b76f21d50--2d0a9e7ee1be458cbb9f47bed42fbe62 bbfdc18ec3654329bb34e48c8e2b3e4b HamEvo 2d0a9e7ee1be458cbb9f47bed42fbe62--bbfdc18ec3654329bb34e48c8e2b3e4b daf7ebaf1c0247049f0d215eb1ab9d20 bbfdc18ec3654329bb34e48c8e2b3e4b--daf7ebaf1c0247049f0d215eb1ab9d20 77e36a56ccf4428f99f6c7b453e8e29b daf7ebaf1c0247049f0d215eb1ab9d20--77e36a56ccf4428f99f6c7b453e8e29b eced7d4a6b2c4d0b8a25746c40d2ca09 52fedca995334e5fbfd99332b74cacf3 15ad7e97636e4ba78e4de8a49809c0ef--52fedca995334e5fbfd99332b74cacf3 479fd025f90b43bbafdd0d7fbf0daef6 2 db08516e194548cda505c95affc41d66 t = -0.500 52fedca995334e5fbfd99332b74cacf3--db08516e194548cda505c95affc41d66 9d0af6a644f9492ab22a13d5d001b879 db08516e194548cda505c95affc41d66--9d0af6a644f9492ab22a13d5d001b879 ec6c787e591e458daeeba38527799ada X 9d0af6a644f9492ab22a13d5d001b879--ec6c787e591e458daeeba38527799ada 0a5b6b05dd3a4548981a399cc8fb92d2 t = -0.500 ec6c787e591e458daeeba38527799ada--0a5b6b05dd3a4548981a399cc8fb92d2 557c2b30920446c4bc37b8e661e5663c X 0a5b6b05dd3a4548981a399cc8fb92d2--557c2b30920446c4bc37b8e661e5663c 557c2b30920446c4bc37b8e661e5663c--eced7d4a6b2c4d0b8a25746c40d2ca09 81f4bae136f442d3a38900222aece68c d3cddea68d54484abf3ceb28f9b656d1 X 479fd025f90b43bbafdd0d7fbf0daef6--d3cddea68d54484abf3ceb28f9b656d1 56821b23b05442609eae8cdfafe2d27c d3cddea68d54484abf3ceb28f9b656d1--56821b23b05442609eae8cdfafe2d27c 3ac5073e559e429fbbbb1fd646774594 X 56821b23b05442609eae8cdfafe2d27c--3ac5073e559e429fbbbb1fd646774594 3efe4d5c47ea4b9cb8f5896149ad8b58 X 3ac5073e559e429fbbbb1fd646774594--3efe4d5c47ea4b9cb8f5896149ad8b58 8c5e0d96f7774accac5cf7116d068ed9 3efe4d5c47ea4b9cb8f5896149ad8b58--8c5e0d96f7774accac5cf7116d068ed9 b9b56a10e3d94cc8aec654675102bb6a X 8c5e0d96f7774accac5cf7116d068ed9--b9b56a10e3d94cc8aec654675102bb6a b9b56a10e3d94cc8aec654675102bb6a--81f4bae136f442d3a38900222aece68c

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_7ffb5e1d070847e5b756f851be1f33d8 cluster_bb60312bf73642959c9c248551b1a9b8 3edda595386645ccb679a004db33586c 0 94939aeb989a4ba3877f0548e5c9b431 X 3edda595386645ccb679a004db33586c--94939aeb989a4ba3877f0548e5c9b431 6ea394b6c41146f9bfb28ebe54f41f1f 1 02561d88b37a434781d16524cba98d0c HamEvo 94939aeb989a4ba3877f0548e5c9b431--02561d88b37a434781d16524cba98d0c 5967ca2cabb1414c859d3214fd446932 X 02561d88b37a434781d16524cba98d0c--5967ca2cabb1414c859d3214fd446932 9e4a0769978c4ac8b800e8db80c3a94e 5967ca2cabb1414c859d3214fd446932--9e4a0769978c4ac8b800e8db80c3a94e eb3dc96382c84129bf4a28d17dbc7db7 HamEvo 9e4a0769978c4ac8b800e8db80c3a94e--eb3dc96382c84129bf4a28d17dbc7db7 63d2d5b9b68a48b39c20af01c367e5bb eb3dc96382c84129bf4a28d17dbc7db7--63d2d5b9b68a48b39c20af01c367e5bb a7de56c6286b41b7ab2cd0ac23664c7c 63d2d5b9b68a48b39c20af01c367e5bb--a7de56c6286b41b7ab2cd0ac23664c7c 8e2a3794e0664d19a581301c3ed470b1 df89a0b0b97f4dcbb33d9fbb623296fc 6ea394b6c41146f9bfb28ebe54f41f1f--df89a0b0b97f4dcbb33d9fbb623296fc 3909058a7c1b44218d707582cac058cf 2 7be7a6a463d34ee4b7655eea2b474ce4 t = -500.000000000000 df89a0b0b97f4dcbb33d9fbb623296fc--7be7a6a463d34ee4b7655eea2b474ce4 c9bd11ddcb3e446d9254625636db2207 7be7a6a463d34ee4b7655eea2b474ce4--c9bd11ddcb3e446d9254625636db2207 3ed0aa2e93a84af9af76e3953837b920 X c9bd11ddcb3e446d9254625636db2207--3ed0aa2e93a84af9af76e3953837b920 1e493cbb3ea74483a9fb2e86e60674b8 t = -500.000000000000 3ed0aa2e93a84af9af76e3953837b920--1e493cbb3ea74483a9fb2e86e60674b8 6a50c060773f4758a3af2756baefe780 X 1e493cbb3ea74483a9fb2e86e60674b8--6a50c060773f4758a3af2756baefe780 6a50c060773f4758a3af2756baefe780--8e2a3794e0664d19a581301c3ed470b1 29444aca0d36470086e7de1a3fb9ce5f e2032bec3d854f8c9d03bea1892e93dd X 3909058a7c1b44218d707582cac058cf--e2032bec3d854f8c9d03bea1892e93dd beb505652d5b462d86a1be33db016a51 e2032bec3d854f8c9d03bea1892e93dd--beb505652d5b462d86a1be33db016a51 50a6b8c35898441eb6d1876f7e975604 X beb505652d5b462d86a1be33db016a51--50a6b8c35898441eb6d1876f7e975604 d3c2cde021694ea5913469345443b551 X 50a6b8c35898441eb6d1876f7e975604--d3c2cde021694ea5913469345443b551 d5ee35ec19144aa6b022be0a974c7394 d3c2cde021694ea5913469345443b551--d5ee35ec19144aa6b022be0a974c7394 5c508c7e4ddb46a9aee2637ae903dc4f X d5ee35ec19144aa6b022be0a974c7394--5c508c7e4ddb46a9aee2637ae903dc4f 5c508c7e4ddb46a9aee2637ae903dc4f--29444aca0d36470086e7de1a3fb9ce5f

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