Dear Dibyendu,

thanks for discovering this problem. 
Its an internal problem of Tkwant, which I did not get in Python 3.6, 
but only in higher Python versions due to a different rounding of numbers.
I made a fix for which you need to build the development version on branch 
master as described in the tutorial, its not yet on Conda.
After update the tutorial example should run properly.

Best,
Thomas

----- Mail original -----
De: "Dibyendu Kuiri" <ku...@agh.edu.pl>
À: "kwant-discuss" <kwant-disc...@kwant-project.org>
Envoyé: Vendredi 22 Septembre 2023 15:21:14
Objet: [Kwant] Issue with Tutorial Example

Dear Tkwant Forum,

I hope this message finds you well.

I am writing to bring to your attention an issue I encountered while 
trying to follow the tutorial on Tkwant. I am using Ubuntu 22.04.3 LTS 
." Unfortunately, the example provided in the tutorial does not seem to 
be functioning as expected in this environment.

Here are the details of my system:
Description:
Ubuntu 22.04.3 LTS
In [1]: import kwant

In [2]: kwant.__version__
Out[2]: '1.4.4'

In [3]: import tkwant

In [4]: tkwant.__version__
Out[4]: '1.1.0'

numpy.__version__)"
1.25.2
scipy.__version__)"
1.11.2



I am getting the error as
"/home/dkuiri/Dropbox/Tkwant/1d_wire_onsite.py:53: RuntimeWarning: 
Kwant's plotting functions have
the side effect of selecting the matplotlib backend. To avoid this 
warning,
import matplotlib.pyplot, matplotlib.backends or call matplotlib.use().
   kwant.plot(syst)
capi_return is NULL
Call-back cb_fcn_in___user__routines failed.
Traceback (most recent call last):
   File "/home/dkuiri/Dropbox/Tkwant/1d_wire_onsite.py", line 88, in 
<module>
     main()
   File "/home/dkuiri/Dropbox/Tkwant/1d_wire_onsite.py", line 73, in main
     state.evolve(time)
   File 
"/opt/miniconda3/envs/python3/lib/python3.9/site-packages/tkwant/manybody.py", 
line 2134, in evolve
     self.manybody_wavefunction.evolve(time)
   File 
"/opt/miniconda3/envs/python3/lib/python3.9/site-packages/tkwant/manybody.py", 
line 973, in evolve
     onebody_psi.evolve(time)
   File 
"/opt/miniconda3/envs/python3/lib/python3.9/site-packages/tkwant/onebody/onebody.py",
 
line 442, in evolve
     next_psibar = self.solver(self.psibar, self.time, time,
   File "tkwant/onebody/solvers.pyx", line 69, in 
tkwant.onebody.solvers.Scipy.__call__
   File 
"/home/dkuiri/.local/lib/python3.9/site-packages/scipy/integrate/_ode.py", 
line 1174, in run
     x, y, iwork, istate = self.runner(*((f, t0, y0, t1) +
   File "tkwant/onebody/solvers.pyx", line 60, in 
tkwant.onebody.solvers.Scipy._rhs
   File "tkwant/onebody/kernels.pyx", line 983, in 
tkwant.onebody.kernels._CalcRHSc.__call__
   File "tkwant/onebody/kernels.pyx", line 977, in 
tkwant.onebody.kernels._CalcRHSc.__call__
   File "tkwant/onebody/kernels.pyx", line 801, in 
tkwant.onebody.kernels.PerturbationInterpolator.apply
   File "tkwant/onebody/kernels.pyx", line 769, in 
tkwant.onebody.kernels.PerturbationInterpolator.evaluate
   File "tkwant/onebody/kernels.pyx", line 361, in 
tkwant.onebody.kernels.Interpolation.eval
   File "tkwant/onebody/kernels.pyx", line 416, in 
tkwant.onebody.kernels.Interpolation._estimate_stepsize
TypeError: Cannot convert 'complex' with non-zero imaginary component to 
'double' (this most likely comes from the '**' operator; use 
'cython.cpow(True)' to return 'nan' instead of a complex number)."

The issue I am facing, is it related the specific version?
I would greatly appreciate any guidance or suggestions you can provide 
to help me resolve this issue and successfully complete the tutorial.

Thank you for your assistance.

Many thanks,
Dibyendu Kuiri,
Academic Centre for Materials and Nanotechnology
AGH University of Science and Technology.
Av. Mickiewicza 30
30-059 Krakow, Poland.

email: ku...@agh.edu.pl
Phone no: +48 881293791
www.acmin.agh.edu.pl

Reply via email to