TypeError Traceback (most recent call last)
/home/ali/anaconda3/lib/python3.6/site-packages/kwant/builder.py in hamiltonian(self, i, j, params, *args)
1995 try:
-> 1996 value = value(self.sites[i], **params)
1997 except Exception as exc:
<string> in onsite(site, Delta_0, E_0, E_v, P, gamma_0, gamma_1, gamma_2, hbar, k_y, m_0)
TypeError: __call__() takes 2 positional arguments but 3 were given
The above exception was the direct cause of the following exception:
UserCodeError Traceback (most recent call last)
<ipython-input-5-9c34d828bfe1> in <module>()
59 # compute the scattering matrix at a given energy
60 p = {'k_y': 0, **two_deg_params}
---> 61 smatrix = kwant.smatrix(syst, energy, params=p)
62
63 # compute the transmission probability from lead 0 to
/home/ali/anaconda3/lib/python3.6/site-packages/kwant/solvers/common.py in smatrix(self, sys, energy, args, out_leads, in_leads, check_hermiticity, params)
370 linsys, lead_info = self._make_linear_sys(syst, in_leads, energy, args,
371 check_hermiticity, False,
--> 372 params=params)
373
374 kept_vars = np.concatenate([coords for i, coords in
/home/ali/anaconda3/lib/python3.6/site-packages/kwant/solvers/common.py in _make_linear_sys(self, sys, in_leads, energy, args, check_hermiticity, realspace, params)
162 lhs, norb = syst.hamiltonian_submatrix(args, sparse=True,
163 return_norb=True,
--> 164 params=params)[:2]
165 lhs = getattr(lhs, 'to' + self.lhsformat)()
166 lhs = lhs - energy * sp.identity(lhs.shape[0], format=self.lhsformat)
kwant/_system.pyx in kwant._system.hamiltonian_submatrix()
/home/ali/anaconda3/lib/python3.6/site-packages/kwant/builder.py in hamiltonian(self, i, j, params, *args)
1996 value = value(self.sites[i], **params)
1997 except Exception as exc:
-> 1998 _raise_user_error(exc, value)
1999 else:
2000 try:
/home/ali/anaconda3/lib/python3.6/site-packages/kwant/builder.py in _raise_user_error(exc, func)
1883 msg = ('Error occurred in user-supplied value function "{0}".\n'
1884 'See the upper part of the above backtrace for more information.')
-> 1885 raise UserCodeError(msg.format(func.__name__)) from exc
1886
1887
UserCodeError: Error occurred in user-supplied value function "onsite".
See the upper part of the above backtrace for more information.