Hi! I'm trying to plot (map) the potential on each site of a system (quantum wire in this case) - In which order 'site_color' passes the values to cmap, or what's happening here? I'd like to see the top line of sites whiter - I get the same color for each atom when I run several times. Is this because 'kwant.digest.uniform' is not so random? Thanks in advance Julian -- ------------------------------ This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
Dear Julian, Two things: First, with your code, you actually make the first column of the system "hotter" (your i is the index along the wire). But apart from that, indeed your plot is not exactly what you wanted to have: in a sense it is a bug of kwant that it accepts your input. You are plotting an unfinalized system, and you give as color a list - there is no way that kwant can tell which lattice point belongs to which entry in the list (sites are not stored in the order they are added to the system!) We should check for this invalid input, it should not have been accepted. plot in this particular case only should accept constants or functions that take a lattice site as an argument. You can do what you want more directly: kwant.plotter.plot(sys_2['sys'], site_color=lambda site: sys_2['sys'][site], colorbar = True, cmap='gist_heat') There is no need for the col_mtx array. As for the randomness of digest: It passes certain tests for randomness (check documentation), it is random - the eye is not really good for seeing randomness (we like to see patterns). Best, Michael On 05.03.2015 10:16, Julian Moreno wrote:
Hi! I'm trying to plot (map) the potential on each site of a system (quantum wire in this case)
- In which order 'site_color' passes the values to cmap, or what's happening here? I'd like to see the top line of sites whiter - I get the same color for each atom when I run several times. Is this because 'kwant.digest.uniform' is not so random?
Thanks in advance
Julian
------------------------------------------------------------------------ This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
Hi Julien, I'd like to add to Michael's response with respect to the randomness of `kwant.digest`. You wrote:
- I get the same color for each atom when I run several times. Is this because 'kwant.digest.uniform' is not so random?
It seems as if you are expecting that the site colours should change every time you run your code, i.e. that the onsites should change value on each run. The point of the algorithms in `kwant.digest` is that they are hashing algorithms, and *not* pseudo-random number generators. A hashing function always returns the same output if given the same input, but the distance between two points in the domain of the hashing function is in no way correlated to the distance between the images of the two points in the co-domain (if the hashing function is any good!). This makes a hashing function a good candidate for modeling disorder, as the spatial separation of sites will not be correlated to their onsites. It does, however, mean that the *same* site will have the *same* onsite in subsequent runs of the code, which is the expected behaviour for a hashing function. This means that you can have reproducible disorder configurations. If you would like to realise different disorder configurations, you can simply use a different `salt` argument to `kwant.digest.uniform`: kwant.digest.uniform(repr(site), salt='config1') or just tack a string onto the end of the site repr: kwant.digest.uniform(repr(site) + 'config1') Hope that clarifies a bit, Joe
Great, now I understand more
thank you both for the quick responses
Julian
On Thu, Mar 5, 2015 at 2:24 PM, Joseph Weston
Hi Julien,
I'd like to add to Michael's response with respect to the randomness of `kwant.digest`. You wrote:
- I get the same color for each atom when I run several times. Is this because 'kwant.digest.uniform' is not so random?
It seems as if you are expecting that the site colours should change every time you run your code, i.e. that the onsites should change value on each run. The point of the algorithms in `kwant.digest` is that they are hashing algorithms, and *not* pseudo-random number generators. A hashing function always returns the same output if given the same input, but the distance between two points in the domain of the hashing function is in no way correlated to the distance between the images of the two points in the co-domain (if the hashing function is any good!).
This makes a hashing function a good candidate for modeling disorder, as the spatial separation of sites will not be correlated to their onsites. It does, however, mean that the *same* site will have the *same* onsite in subsequent runs of the code, which is the expected behaviour for a hashing function. This means that you can have reproducible disorder configurations.
If you would like to realise different disorder configurations, you can simply use a different `salt` argument to `kwant.digest.uniform`:
kwant.digest.uniform(repr(site), salt='config1')
or just tack a string onto the end of the site repr:
kwant.digest.uniform(repr(site) + 'config1')
Hope that clarifies a bit,
Joe
-- ------------------------------ This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
participants (3)
-
Joseph Weston
-
Julian Moreno
-
Michael Wimmer