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_9ee28635b94b423db99796ef76b80700 cluster_1ee93fc43c74424a98a5e6b7d7ed900f cluster_539b4197291e469492efbb4c9b0b566e cluster_bd38f04f2c8648d39e50096e2d23bc41 cluster_86a463871b974581a9efba2dee8b2d20 cluster_c47fb95b6c6741e5b12dc223487da550 cluster_e4f44d25b59e4c0b9c00471794794766 bfb01a2432fe4b9fa0b3de797c5086de 0 6cafe05f8a754a4eb6c654b78550dbd3 HamEvo bfb01a2432fe4b9fa0b3de797c5086de--6cafe05f8a754a4eb6c654b78550dbd3 e0fb1ef810ca4033a2290c1ed4085c9b 1 b51d69b3dc4747298fc0f511ed6be039 HamEvo 6cafe05f8a754a4eb6c654b78550dbd3--b51d69b3dc4747298fc0f511ed6be039 c587ab15434a406ba1a8c44e3956b28d HamEvo b51d69b3dc4747298fc0f511ed6be039--c587ab15434a406ba1a8c44e3956b28d 1d026764a8af495fb0cacde667a9fa06 X c587ab15434a406ba1a8c44e3956b28d--1d026764a8af495fb0cacde667a9fa06 3ebda324464649d3859c94366ec9ec7e HamEvo 1d026764a8af495fb0cacde667a9fa06--3ebda324464649d3859c94366ec9ec7e 05aa1ac6f8324690b8f4eb6c33b56e3d HamEvo 3ebda324464649d3859c94366ec9ec7e--05aa1ac6f8324690b8f4eb6c33b56e3d 6f68c76640d046ed9e8d1f837adce71f X 05aa1ac6f8324690b8f4eb6c33b56e3d--6f68c76640d046ed9e8d1f837adce71f 22a1135139674275b0c534a844781700 6f68c76640d046ed9e8d1f837adce71f--22a1135139674275b0c534a844781700 4b9ab6b7bf3a40b1a85e6ddbebf9f2fb HamEvo 22a1135139674275b0c534a844781700--4b9ab6b7bf3a40b1a85e6ddbebf9f2fb 75b98791599e487fb98db6135cda46fa HamEvo 4b9ab6b7bf3a40b1a85e6ddbebf9f2fb--75b98791599e487fb98db6135cda46fa 86f43f02b7a74573bf11b5ed11a47352 75b98791599e487fb98db6135cda46fa--86f43f02b7a74573bf11b5ed11a47352 8c97ec6e0cc5425eb99bccfd5d89ee29 86f43f02b7a74573bf11b5ed11a47352--8c97ec6e0cc5425eb99bccfd5d89ee29 faa2471c0b2347628d2e8524ac91c75c b7851b0bc30948d1b88ae085a3ce9fc2 t = -3.142 e0fb1ef810ca4033a2290c1ed4085c9b--b7851b0bc30948d1b88ae085a3ce9fc2 1fd6a62e58ba4324981c480fd3362c3a 2 ff0fda46552a4331a65f912e60dedbb5 t = 3.142 b7851b0bc30948d1b88ae085a3ce9fc2--ff0fda46552a4331a65f912e60dedbb5 29e7607b063d445cb73bd6844d0722a0 t = -3.142 ff0fda46552a4331a65f912e60dedbb5--29e7607b063d445cb73bd6844d0722a0 0b7fa8bb30f04922882848d8539b2346 29e7607b063d445cb73bd6844d0722a0--0b7fa8bb30f04922882848d8539b2346 140713577c134f6c9eb09268fd2169dd t = 1.571 0b7fa8bb30f04922882848d8539b2346--140713577c134f6c9eb09268fd2169dd 7cebfe78db68448d9b366f284b880f52 t = 1.571 140713577c134f6c9eb09268fd2169dd--7cebfe78db68448d9b366f284b880f52 fbb7f603f8564deca5c98e804446b1c5 7cebfe78db68448d9b366f284b880f52--fbb7f603f8564deca5c98e804446b1c5 4cabe85ac05947e3b955a824a9069661 X fbb7f603f8564deca5c98e804446b1c5--4cabe85ac05947e3b955a824a9069661 b27b13efafcd4cbb8f24c6f0702ec8d1 t = 1.571 4cabe85ac05947e3b955a824a9069661--b27b13efafcd4cbb8f24c6f0702ec8d1 f85ee176ca3c4f32bdcef12e2f1669b3 t = 1.571 b27b13efafcd4cbb8f24c6f0702ec8d1--f85ee176ca3c4f32bdcef12e2f1669b3 222fb8fd6fd9423e8b18b2abb0b4af7c X f85ee176ca3c4f32bdcef12e2f1669b3--222fb8fd6fd9423e8b18b2abb0b4af7c 222fb8fd6fd9423e8b18b2abb0b4af7c--faa2471c0b2347628d2e8524ac91c75c 05e33fd2872448f395ce0544da2e06d4 36df8116250e4023864c2a62e8a42a5d 1fd6a62e58ba4324981c480fd3362c3a--36df8116250e4023864c2a62e8a42a5d 9407f764b80d4de680d78e14e76af145 36df8116250e4023864c2a62e8a42a5d--9407f764b80d4de680d78e14e76af145 ab2e41f5e0af4312b63fd197e03f841f 9407f764b80d4de680d78e14e76af145--ab2e41f5e0af4312b63fd197e03f841f bf6c34133439488d9597635b9d2246b0 X ab2e41f5e0af4312b63fd197e03f841f--bf6c34133439488d9597635b9d2246b0 303320a0748340159b769ff9dddd012b bf6c34133439488d9597635b9d2246b0--303320a0748340159b769ff9dddd012b 3f9c79f7ca2d4351ac7290f6bde7a43f 303320a0748340159b769ff9dddd012b--3f9c79f7ca2d4351ac7290f6bde7a43f a8b01c1d02a146bf840a5929963c2c78 X 3f9c79f7ca2d4351ac7290f6bde7a43f--a8b01c1d02a146bf840a5929963c2c78 fa22c7a6c16f475bb19763db61adf567 X a8b01c1d02a146bf840a5929963c2c78--fa22c7a6c16f475bb19763db61adf567 5b0d099612574647938a429e91a92f97 fa22c7a6c16f475bb19763db61adf567--5b0d099612574647938a429e91a92f97 ddfe25b98fd94bb5854f58727e3c2004 5b0d099612574647938a429e91a92f97--ddfe25b98fd94bb5854f58727e3c2004 e40d71a0775c41ea875006e289211286 X ddfe25b98fd94bb5854f58727e3c2004--e40d71a0775c41ea875006e289211286 e40d71a0775c41ea875006e289211286--05e33fd2872448f395ce0544da2e06d4

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_bd9a6f7eae3e44c8b99e579bf86ec529 cluster_abc20a5c3a654c28ad561e1323e328c6 5aae1c65dfef4d54acb02819050a5f11 0 72658944ade249698eba92527712d7d3 X 5aae1c65dfef4d54acb02819050a5f11--72658944ade249698eba92527712d7d3 5e15360d6b804417aeabc32ea59aec4b 1 8af17a1ccf1648c5944f9554c79cbc04 HamEvo 72658944ade249698eba92527712d7d3--8af17a1ccf1648c5944f9554c79cbc04 8576df82cde1455cb63867f62b12a535 X 8af17a1ccf1648c5944f9554c79cbc04--8576df82cde1455cb63867f62b12a535 32a7473e29c44d22b6a4f10046ec37fa 8576df82cde1455cb63867f62b12a535--32a7473e29c44d22b6a4f10046ec37fa de5d75750b0847338706ad3e0018a169 HamEvo 32a7473e29c44d22b6a4f10046ec37fa--de5d75750b0847338706ad3e0018a169 84275d74e67e42f28dce37cf7eaa96df de5d75750b0847338706ad3e0018a169--84275d74e67e42f28dce37cf7eaa96df 16f6fc0a71504e879d47662173cacb51 84275d74e67e42f28dce37cf7eaa96df--16f6fc0a71504e879d47662173cacb51 7bd69a9e0772495e86dd153c3fa8aa33 e93e7a4bf7544f23aa82d5c9a11324ad 5e15360d6b804417aeabc32ea59aec4b--e93e7a4bf7544f23aa82d5c9a11324ad 239d17288e4746188e762f6e2f0290a8 2 50cec73b3c924faf9eca954c89afa60f t = -0.500 e93e7a4bf7544f23aa82d5c9a11324ad--50cec73b3c924faf9eca954c89afa60f 1b6c8a1d7ffb4b8ea00938bb033a3c88 50cec73b3c924faf9eca954c89afa60f--1b6c8a1d7ffb4b8ea00938bb033a3c88 7394689ea1a34259b06e61ef12724b2c X 1b6c8a1d7ffb4b8ea00938bb033a3c88--7394689ea1a34259b06e61ef12724b2c 70f19942265f4ea2a37e7e40d51b0eca t = -0.500 7394689ea1a34259b06e61ef12724b2c--70f19942265f4ea2a37e7e40d51b0eca d09faf89d2a44fb390120d569bb425d8 X 70f19942265f4ea2a37e7e40d51b0eca--d09faf89d2a44fb390120d569bb425d8 d09faf89d2a44fb390120d569bb425d8--7bd69a9e0772495e86dd153c3fa8aa33 7b6df47c14114d719b89dd8d2e5e138f 1ef7b9c365d84ff393dc6ae6f533f0d1 X 239d17288e4746188e762f6e2f0290a8--1ef7b9c365d84ff393dc6ae6f533f0d1 8f677be734a346fb8dc2b3bf051aa72b 1ef7b9c365d84ff393dc6ae6f533f0d1--8f677be734a346fb8dc2b3bf051aa72b 66605532ea0a4656b988fdcfc75a6625 X 8f677be734a346fb8dc2b3bf051aa72b--66605532ea0a4656b988fdcfc75a6625 35e5c3c26ca944e582dcdccb2c87fd93 X 66605532ea0a4656b988fdcfc75a6625--35e5c3c26ca944e582dcdccb2c87fd93 f9d465cda35e432282aeb3615c1d13d3 35e5c3c26ca944e582dcdccb2c87fd93--f9d465cda35e432282aeb3615c1d13d3 a357f2a44c174cb5a6ef502b1671b0d9 X f9d465cda35e432282aeb3615c1d13d3--a357f2a44c174cb5a6ef502b1671b0d9 a357f2a44c174cb5a6ef502b1671b0d9--7b6df47c14114d719b89dd8d2e5e138f

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_526e6eac59c94d5fb322f9c7c9b1e1b5 cluster_6051601cd2e247b588dd9949336293b7 a41a8e1c2f554b6cb5cafaf3cec53545 0 360100b1b76040ec83a7631bbba0c4d4 X a41a8e1c2f554b6cb5cafaf3cec53545--360100b1b76040ec83a7631bbba0c4d4 d795c0f4330a4aa8922f9dfabb99b390 1 73be23ed16314a1b8c23878fd9f3914e HamEvo 360100b1b76040ec83a7631bbba0c4d4--73be23ed16314a1b8c23878fd9f3914e 364573bfa88e4a65807e915063485dbc X 73be23ed16314a1b8c23878fd9f3914e--364573bfa88e4a65807e915063485dbc 02b7810f2a3f4de397b6e2526e4f8756 364573bfa88e4a65807e915063485dbc--02b7810f2a3f4de397b6e2526e4f8756 7734726e1a90472e9ad4c6df2eb4079c HamEvo 02b7810f2a3f4de397b6e2526e4f8756--7734726e1a90472e9ad4c6df2eb4079c 27d6751032074193ab4f66a04c22fd6e 7734726e1a90472e9ad4c6df2eb4079c--27d6751032074193ab4f66a04c22fd6e dcb9538ba4754adcb434b1bfc69f9951 27d6751032074193ab4f66a04c22fd6e--dcb9538ba4754adcb434b1bfc69f9951 9b62a60fdae24c0d96187b5e3825d6e6 e13f406f683746d7b2af1c94e038f083 d795c0f4330a4aa8922f9dfabb99b390--e13f406f683746d7b2af1c94e038f083 5c99a9fa601a4220bdb1a87e8875f535 2 831295d50ae04c6789c70c3d3bfb9ec9 t = -500.000000000000 e13f406f683746d7b2af1c94e038f083--831295d50ae04c6789c70c3d3bfb9ec9 af197c3a914b48eeb3257dfd7e69e90b 831295d50ae04c6789c70c3d3bfb9ec9--af197c3a914b48eeb3257dfd7e69e90b cac53fd6f6fd4d81b5cf51fbc7ff9048 X af197c3a914b48eeb3257dfd7e69e90b--cac53fd6f6fd4d81b5cf51fbc7ff9048 469fcad5b9b14b87bd4e24234e8179a4 t = -500.000000000000 cac53fd6f6fd4d81b5cf51fbc7ff9048--469fcad5b9b14b87bd4e24234e8179a4 d5bfde2f20704ca7991b2ef1e8905728 X 469fcad5b9b14b87bd4e24234e8179a4--d5bfde2f20704ca7991b2ef1e8905728 d5bfde2f20704ca7991b2ef1e8905728--9b62a60fdae24c0d96187b5e3825d6e6 0eb76ad166a64387a2df7dca38968953 90c0c1329b99478386d19a3000190bd9 X 5c99a9fa601a4220bdb1a87e8875f535--90c0c1329b99478386d19a3000190bd9 5c4794a5afb542c0afd4dd6fc68671a8 90c0c1329b99478386d19a3000190bd9--5c4794a5afb542c0afd4dd6fc68671a8 a8f240fccb8c4ace84ef861193bae501 X 5c4794a5afb542c0afd4dd6fc68671a8--a8f240fccb8c4ace84ef861193bae501 ba1156c2e06e41cf86ac7fa5aa0f8551 X a8f240fccb8c4ace84ef861193bae501--ba1156c2e06e41cf86ac7fa5aa0f8551 62dc8909393e4a8ba3d5accb5838068f ba1156c2e06e41cf86ac7fa5aa0f8551--62dc8909393e4a8ba3d5accb5838068f 38bb762cbbe2463187ac79ca45a6a463 X 62dc8909393e4a8ba3d5accb5838068f--38bb762cbbe2463187ac79ca45a6a463 38bb762cbbe2463187ac79ca45a6a463--0eb76ad166a64387a2df7dca38968953

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