Git Product home page Git Product logo

Comments (2)

BertJorissen avatar BertJorissen commented on July 28, 2024

Hi Chenqiang
I'm not certain if you really want to use the map_probability_at-function. This function tries to select the state in the wavefunction (set of eigenvectors) that co insides with the selected position, and gives the probability of that state (eigenvector). You thus only see a selection of the wavefunction.
We are currently working on a new release. You can download the new release by first removing your old version of Pybinding with pip uninstall pybinding and then running pip install -i https://test.pypi.org/simple/ pybinding.
In the new version, you have the possibility to calculate the wavefunction and a lot of new interesting things.

Regarding your question: the plot you get is a kind of scatter plot with some interesting decorations. It just puts all the eigenvalues from 0 to 100 on a plot. I think this is not that interesting at all, but the functionality is there if you want to use it. I rather suggest using the spatial-LDOS. Now, you can calculate the wavefunction over an area and obtain an accurate approximation for this.

You can obtain the current axis in matplotlib with ax=plt.gca(). The rest works as expected.

Bellow an example of the new functionalities:

import pybinding as pb
import numpy as np
import matplotlib.pyplot as plt
from pybinding.repository.graphene import bilayer

def asymmetric_strain(c):
    @pb.site_position_modifier
    def displacement(x, y, z):
        ux = -c/2 * x**2 + c/3 * x + 0.1
        uy = -c*2 * x**2 + c/4 * x
        return x + ux, y + uy, z
    return displacement

model = pb.Model(bilayer(), pb.regular_polygon(num_sides=3, radius=1.1), asymmetric_strain(c=0.42))

solver = pb.solver.lapack(model)
eigen = solver.calc_eigenvalues(map_probability_at=[0,0])

fig, (ax1, ax2) = plt.subplots(2)
eigen.plot_heatmap(ax=ax2)
ax2.set_xlim([20, 100])
ax2.set_ylim([-5, 5])

wfc = solver.calc_wavefunction([0, 0], [0, .1])
sldos = wfc.spatial_ldos(np.linspace(-1, 1, 100), 0.05)
sldos.structure_map(0).plot(ax=ax1)

wfc
Best
Bert

from pybinding.

ChenqiangHua avatar ChenqiangHua commented on July 28, 2024

Thanks sir! I have installed the new version and it fixs my question well! I can't wait to explore new interesting things in this new version.

Thx again!
Chenqiang Hua

from pybinding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.