question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Draw Bond-Currents with sisl

See original GitHub issue

Hi Nick,

I got a tutorial on calculating the bond-current from your answer here. And I tried to draw the bonding current of graphene. But the atom is not shown in the graph, and the image does not seem to be correct. image

This is the code:

import os
import numpy as np
import sisl

# Now read in the AV file
av = sisl.get_sile('graphene_scat.TBT.AV.nc')
geom = av.geom


J_orb = av.orbital_current('Left', E=2, isc=[None] * 3)
J_a = av.atom_current_from_orbital(J_orb, activity=False)

#J_v = av.vector_current_from_orbital(J_orb)

# Now create plot
from matplotlib.colors import Colormap
from matplotlib.mlab import griddata
import matplotlib.pyplot as plt

def mmlinspace(a, axis, N):
    m, M = np.min(a[:, axis]), np.max(a[:, axis])
    return np.linspace(m, M, N)

N_x, N_y = 2000, 2000
x = mmlinspace(geom.xyz, 0, N_x)
y = mmlinspace(geom.xyz, 1, N_y)

xi, yi = np.meshgrid(x, y)
zi = griddata(geom.xyz[:, 0], geom.xyz[:, 1], J_a, xi, yi, interp='linear')

cm = Colormap('inferno')
plt.contourf(xi, yi, zi, cmap=plt.cm.plasma)
plt.savefig('test2.png')

plt.show()

My question is how to set “J_orb” correct in the code, and If I expect to get both the atom and bond-current, What changes should I make for this code?

Best Regards~

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Mr-Beycommented, Sep 5, 2018

Yes,it resolved. And thanks a lot for your help!Cheers!XD

0reactions
zerothicommented, Sep 4, 2018

I will consider this issue resolved 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Positive valued bond-currents plotted as line segments of ...
We select only positive bond currents and for each of them we draw a segment ... sisl is a Python package used to...
Read more >
arXiv:2109.03790v2 [cond-mat.mes-hall] 19 Jan 2022
Equilibrium bond currents are obtained inserting the equilibrium density matrix and ... one must draw on detailed microscopic calculations,.
Read more >
Modelling polycrystalline materials and interfaces
sis [213–216]. The focus is on symmetrical tilt GBs over a wide range GB orientations to draw out trends across the three materials....
Read more >
Current-induced atomic forces in gated graphene ... - CORE
the pristine graphene, bond currents obtain smaller values and ... We draw the force arrows at both atoms of a bond to indicate...
Read more >
Duality in a Model of Layered Superfluids and Sliding Phases
sis. I attended a number of Colloquia and departmental meetings at City Tech ... x Jµ is the winding number along µ direction;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found