Re: [Kwant] Difference between hop[0].tag and hop[1].tag

2019-09-10 Thread Adel Belayadi
Dear Adel,
I do thank you for link. Everything is clear now since the linke describes
in detains (site, family, tag, etc)
Regards
Adel

Le mar. 10 sept. 2019 à 09:40, Abbout Adel  a écrit :

> Dear Adel,
>
> It seems that you did not get it correctly. A hopping is a tuple of two
> sites which make a bond in your lattice. So the direction is not important.
>
> Hop=(site1,site2)
> Hop[0]=site1
> Hop[1]=site2
>
> I suggest to you to have a look at the frequently asked questions in kwant
> [1]. It explains a lot of interesting things.
>
> I hope this helps.
> Regards,
> Adel
>
> [1] https://kwant-project.org/doc/1/tutorial/faq
>
> On Mon, Sep 9, 2019 at 2:15 PM Adel Belayadi  wrote:
>
>> Dear Joseph.
>> Thank you for your reply. If I got it well, you mean the first site the
>> hopping along x direction and second site the hopping in the y direction.
>> Best
>> A.BELAYADI
>>
>> Le lun. 2 sept. 2019 à 09:15, Joseph Weston 
>> a écrit :
>>
>>> Hello,
>>>
>>>
>>> What is the difference between   hop[0].tag   and hop[1].tag
>>>
>>> hop[0].tag is the tag of the first site in the hopping and hop[1].tag is
>>> the tag of the second site in the hopping.
>>>
>>>
>>>
>>> My second question
>>> the onsite fuction for example: def onsite(site, V):return V
>>>
>>> why it depends on site where the shape functions for example
>>> def circle(pos): rsq = pos[0] ** 2 + pos[1] ** 2
>>> depends on pos
>>>
>>> Because  when creating a shape in realspace you typically only care
>>> about the position, whereas your onsite matrix elements could potentially
>>> depend on other things (e.g. the lattice that the site is from)
>>>
>>>
>>> Happy Kwanting,
>>>
>>>
>>> Joe
>>>
>>
>
> --
> Abbout Adel
>


Re: [Kwant] help conda

2019-09-10 Thread Joseph Weston
Hi,

> Dear Sir,
> I have a problem to install Kwant when download the Pre-built packages ( 
> Anaconda package ). That is to say I can't download the package. My  
> operating systems is Microsoft Windows. Can you help me.


Please provide more information; what exact steps did you take when
trying to install Kwant. Did you use the command line and the following
command:

conda install -c conda-forge kwant

or did you use the Anaconda GUI to install the package? In the latter case did 
you make sure to enable the "conda-forge" channel?

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 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


Re: [Kwant] Difference between hop[0].tag and hop[1].tag

2019-09-10 Thread Abbout Adel
Dear Adel,

It seems that you did not get it correctly. A hopping is a tuple of two
sites which make a bond in your lattice. So the direction is not important.

Hop=(site1,site2)
Hop[0]=site1
Hop[1]=site2

I suggest to you to have a look at the frequently asked questions in kwant
[1]. It explains a lot of interesting things.

I hope this helps.
Regards,
Adel

[1] https://kwant-project.org/doc/1/tutorial/faq

On Mon, Sep 9, 2019 at 2:15 PM Adel Belayadi  wrote:

> Dear Joseph.
> Thank you for your reply. If I got it well, you mean the first site the
> hopping along x direction and second site the hopping in the y direction.
> Best
> A.BELAYADI
>
> Le lun. 2 sept. 2019 à 09:15, Joseph Weston  a
> écrit :
>
>> Hello,
>>
>>
>> What is the difference between   hop[0].tag   and hop[1].tag
>>
>> hop[0].tag is the tag of the first site in the hopping and hop[1].tag is
>> the tag of the second site in the hopping.
>>
>>
>>
>> My second question
>> the onsite fuction for example: def onsite(site, V):return V
>>
>> why it depends on site where the shape functions for example
>> def circle(pos): rsq = pos[0] ** 2 + pos[1] ** 2
>> depends on pos
>>
>> Because  when creating a shape in realspace you typically only care about
>> the position, whereas your onsite matrix elements could potentially depend
>> on other things (e.g. the lattice that the site is from)
>>
>>
>> Happy Kwanting,
>>
>>
>> Joe
>>
>

-- 
Abbout Adel