This repository contains the code to reproduce the numerical implementations presented in the manuscript "Algebraic Bethe Circuits".
-
Pyhton>=3.8
-
qibo==0.1.7
-
qibojit==0.04
Pk_gates.py
contains the functions to generate the matrices
from Pk_gates import full_pink
nspins=4
roots=[-0.574,0.574]
delta=0.5
[Pk,Gk]=full_pink(nspins,roots,delta)
bethe_circuit.py
defines the class BetheCircuit
which implements the Algebraic Bethe Ansatz for the XXZ model with both the non-unitary matrices
nspins = 4
nmagnons = 2
roots = [-0.574,0.574]
delta = 0.5
v = BetheCircuit(nspins, nmagnons, delta)
state1 = v.exact(roots)().numpy()
state1 = [state1[i] for i in range(0, len(state1), 2 ** nmagnons)]
state1 /= np.linalg.norm(state1)
state2 = v.aba(roots)().numpy()
print('overlap: ', np.abs(np.dot(np.conjugate(state1), state2)))
print('norm exact', norm(state1))
print('norm circuit', norm(state2))