Re: [Kwant] How to solve the Hamiltonian matrix with off-diagonal terms?

2019-09-10 Thread Joseph Weston
Hi,

> We consider the values of the  conservation law based on the
> off-diagonal term of Hamiltonian matrix, details are as follows:
>
>  
>
> H = tinyarray.array([[0, 0, 0, 1, 0, 0],
>
>     [0, 0, 0, 0, 1, 0],
>
>     [0, 0, 0, 0, 0, 1],
>
>     [1, 0, 0, 0, 0, 0],
>
>     [0, 1, 0, 0, 0, 0],
>
>     [0, 0, 1, 0, 0, 0]])
>

I don't really understand; is this the full Hamiltonian?

> spin_block = tinyarray.array([[0, 0, 0, 1, 0, 0],
>
>      [0, 0, 0, 0, 1, 0],
>
>      [0, 0, 0, 0, 0, 1],
>
>  [-1, 0, 0, 0, 0, 0],
>
>      [0, -1, 0, 0, 0, 0],
>
>      [0, 0, -1, 0, 0, 0]])
>
> And we add “conservation_law= - spin_block” in  “lead=kwant.Builder()”
>
>  
>
> The program can not work, and prompt error:
>
>  
>
> IndexError: index 2 is out of bounds for axis 0 with size 2
>

There is not enough information for me to be able to help you. Please
attach a complete Kwant script.


Happy Kwanting,


Joe



signature.asc
Description: OpenPGP digital signature


Re: [Kwant] How to solve the Hamiltonian matrix with off-diagonal terms?

2019-09-10 Thread Abbout Adel
Dear Yan,

If you post a small part of your program reproducing this  error message,
someone may help you.

Regards,
Adel


On Mon, Sep 9, 2019 at 12:58 PM X.F.Yan  wrote:

>
>
> Dear sir,
>
>
> Recently, we use Kwant to solve for Hamiltonian matrix with off-diagonal
> terms. We successfully calculate the energy band structure and total
> conductance. But unfortunately,  we tried to compute the spin conductance
> without success.
>
>
>
> We consider the values of the  conservation law based on the off-diagonal
> term of Hamiltonian matrix, details are as follows:
>
>
>
> H = tinyarray.array([[0, 0, 0, 1, 0, 0],
>
> [0, 0, 0, 0, 1, 0],
>
> [0, 0, 0, 0, 0, 1],
>
> [1, 0, 0, 0, 0, 0],
>
> [0, 1, 0, 0, 0, 0],
>
> [0, 0, 1, 0, 0, 0]])
>
>
>
>
>
>
>
> spin_block = tinyarray.array([[0, 0, 0, 1, 0, 0],
>
>  [0, 0, 0, 0, 1, 0],
>
>  [0, 0, 0, 0, 0, 1],
>
>  [-1, 0, 0, 0, 0, 0],
>
>  [0, -1, 0, 0, 0, 0],
>
>  [0, 0, -1, 0, 0, 0]])
>
> And we add “conservation_law= - spin_block” in  “lead=kwant.Builder()”
>
>
>
> The program can not work, and prompt error:
>
>
>
> IndexError: index 2 is out of bounds for axis 0 with size 2
>
>
>
> Please help me.
>
>
>
> Thank you,
>
>
>
> Kind regards,
>
> X.F.Yan
>
>
>
>
>
>
>


-- 
Abbout Adel