Coder Social home page Coder Social logo

exactdiag's Introduction

Hi, I'm Dylan ๐Ÿ‘‹

Currently pursuing a PhD in strongly-correlated condensed matter physics at the University of Augsburg. Interested in computational physics, quantum computing, machine learning and programming in general.

Projects

Computational physics

  • lattpy - Simple and efficient Python package for modeling d-dimensional Bravais lattices in solid state physics.
  • exactdiag - Exact diagonalization of fermionic many-body systems.

Music

  • pyrekordbox - Inofficial Python package for interacting with the database and other files (XML, ANLZ, MySettings) of Pioneers Rekordbox DJ software.

Other

  • ftmplt - Simple string parsing and formatting using Python's f-string templates.
  • mplstyles - Collection of scientific Matplotlib styles.

github contribution grid snake animationgithub contribution grid snake animation

exactdiag's People

Contributors

dylanljones avatar pre-commit-ci[bot] avatar

Stargazers

 avatar

Watchers

 avatar

exactdiag's Issues

Green's function using Lehmann sum does not return the expected result for U=0 and N>2

Describe the bug
The Lehmann Green's function does not match the non-interacting GF for U=0 and bulk sites (not 0 or N-1)

To Reproduce
Steps to reproduce the behavior:

import numpy as np
import matplotlib.pyplot as plt
import exactdiag as ed


def greens0(model, z):
    nsites = model.num_sites
    ham = np.zeros((nsites, nsites), dtype=np.float64)
    np.fill_diagonal(ham, model.eps)
    for i, j in model.neighbors:
        ham[i, j] = ham[j, i] = model.hop

    return ed.gf0_pole(ham, z=z, mode="full")


model = ed.models.HubbardModel.chain(3, inter=0.0, beta=200.0).hf()
z = np.linspace(-5, +5, 1001) + 1e-1j

gfmat = ed.greens.compute_gf_full(model, z)
gfmat0 = greens0(model, z)

fig, ax = plt.subplots()
ax.plot(z.real, -gfmat0[:, 1, 1].imag)
ax.plot(z.real, -gfmat[:, 1, 1].imag, ls="--")
plt.show()

Figure_1

Expected behavior
The Green's function should match the non-interacting GF

Numpy/Scipy import error

Running the tests in a GitHub Workflow on Windows using Python 3.10 results in Numpy/Scipy import errors:

ImportError while importing test module 'D:\a\exactdiag\exactdiag\tests\test_basis.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\hostedtoolcache\windows\Python\3.10.7\x64\lib\importlib\__init__.py:1[26](https://github.com/dylanljones/exactdiag/actions/runs/3226005826/jobs/5279006230#step:6:27): in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_basis.py:11: in <module>
    from exactdiag import basis
exactdiag\__init__.py:[27](https://github.com/dylanljones/exactdiag/actions/runs/3226005826/jobs/5279006230#step:6:28): in <module>
    from .matrix import (
exactdiag\matrix.py:11: in <module>
    from scipy.sparse import spmatrix
C:\hostedtoolcache\windows\Python\3.10.7\x64\lib\site-packages\scipy\sparse\__init__.py:267: in <module>
    from ._csr import *
C:\hostedtoolcache\windows\Python\3.10.7\x64\lib\site-packages\scipy\sparse\_csr.py:10: in <module>
    from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,
E   ImportError: numpy.core.multiarray failed to import
------------------------------- Captured stderr -------------------------------
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe

Running the tests local with the same dependencies from the requirements.txt file works as expected for Python versions 3.7-3.10

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.