sparse-ir


Namesparse-ir JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/SpM-lab/sparse-ir
Summaryintermediate representation (IR) basis for electronic propagator
upload_time2024-03-24 08:12:51
maintainerNone
docs_urlNone
author['Markus Wallerberger', 'Hiroshi Shinaoka', 'Kazuyoshi Yoshimi', 'Junya Otsuki', 'Chikano Naoya']
requires_python>=3
licenseNone
keywords irbasis many-body propagator svd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sparse-ir - A library for the intermediate representation of propagators
========================================================================
This library provides routines for constructing and working with the
intermediate representation of correlation functions.  It provides:

 - on-the-fly computation of basis functions for arbitrary cutoff Λ
 - basis functions and singular values are accurate to full precision
 - routines for sparse sampling


Installation
------------
Install via `pip <https://pypi.org/project/sparse-ir>`_::

    pip install sparse-ir[xprec]

The above line is the recommended way to install `sparse-ir`.  It automatically
installs the `xprec <https://github.com/tuwien-cms/xprec>`_ package, which
allows one to compute the IR basis functions with greater accuracy.  If you do
not want to do this, simply remove the string ``[xprec]`` from the above command.

Install via `conda <https://anaconda.org/spm-lab/sparse-ir>`_::

    conda install -c spm-lab sparse-ir xprec

Other than the optional xprec dependency, sparse-ir requires only
`numpy <https://numpy.org/>`_ and `scipy <https://scipy.org/>`_.

To manually install the current development version, you can use the following::

   # Only recommended for developers - no automatic updates!
   git clone https://github.com/SpM-lab/sparse-ir
   pip install -e sparse-ir/[xprec]

Documentation and tutorial
--------------------------
Check out our `comprehensive tutorial`_, where we self-contained
notebooks for several many-body methods - GF(2), GW, Eliashberg equations,
Lichtenstein formula, FLEX, ... - are presented.

Refer to the `API documentation`_ for more details on how to work
with the python library.

There is also a `Julia library`_ and (currently somewhat restricted)
`Fortran library`_ available for the IR basis and sparse sampling.

.. _comprehensive tutorial: https://spm-lab.github.io/sparse-ir-tutorial
.. _API documentation: https://sparse-ir.readthedocs.io
.. _Julia library: https://github.com/SpM-lab/SparseIR.jl
.. _Fortran library: https://github.com/SpM-lab/sparse-ir-fortran

Getting started
---------------
Here is a full second-order perturbation theory solver (GF(2)) in a few
lines of Python code::

    # Construct the IR basis and sparse sampling for fermionic propagators
    import sparse_ir, numpy as np
    basis = sparse_ir.FiniteTempBasis('F', beta=10, wmax=8, eps=1e-6)
    stau = sparse_ir.TauSampling(basis)
    siw = sparse_ir.MatsubaraSampling(basis, positive_only=True)

    # Solve the single impurity Anderson model coupled to a bath with a
    # semicircular states with unit half bandwidth.
    U = 1.2
    def rho0w(w):
        return np.sqrt(1-w.clip(-1,1)**2) * 2/np.pi

    # Compute the IR basis coefficients for the non-interacting propagator
    rho0l = basis.v.overlap(rho0w)
    G0l = -basis.s * rho0l

    # Self-consistency loop: alternate between second-order expression for the
    # self-energy and the Dyson equation until convergence.
    Gl = G0l
    Gl_prev = 0
    while np.linalg.norm(Gl - Gl_prev) > 1e-6:
        Gl_prev = Gl
        Gtau = stau.evaluate(Gl)
        Sigmatau = U**2 * Gtau**3
        Sigmal = stau.fit(Sigmatau)
        Sigmaiw = siw.evaluate(Sigmal)
        G0iw = siw.evaluate(G0l)
        Giw = 1/(1/G0iw - Sigmaiw)
        Gl = siw.fit(Giw)

You may want to start with reading up on the `intermediate representation`_.
It is tied to the analytic continuation of bosonic/fermionic spectral
functions from (real) frequencies to imaginary time, a transformation mediated
by a kernel ``K``.  The kernel depends on a cutoff, which you should choose to
be ``lambda_ >= beta * W``, where ``beta`` is the inverse temperature and ``W``
is the bandwidth.

One can now perform a `singular value expansion`_ on this kernel, which
generates two sets of orthonormal basis functions, one set ``v[l](w)`` for
real frequency side ``w``, and one set ``u[l](tau)`` for the same obejct in
imaginary (Euclidean) time ``tau``, together with a "coupling" strength
``s[l]`` between the two sides.

By this construction, the imaginary time basis can be shown to be *optimal* in
terms of compactness.

.. _intermediate representation: https://arxiv.org/abs/2106.12685
.. _singular value expansion: https://w.wiki/3poQ

License and citation
--------------------
This software is released under the MIT License.  See LICENSE.txt for details.

If you find the intermediate representation, sparse sampling, or this software
useful in your research, please consider citing the following papers:

 - Hiroshi Shinaoka et al., `Phys. Rev. B 96, 035147`_  (2017)
 - Jia Li et al., `Phys. Rev. B 101, 035144`_ (2020)
 - Markus Wallerberger et al., `SoftwareX 21, 101266`_ (2023)

If you are discussing sparse sampling in your research specifically, please
also consider citing an independently discovered, closely related approach, the
MINIMAX isometry method (Merzuk Kaltak and Georg Kresse,
`Phys. Rev. B 101, 205145`_, 2020).

.. _Phys. Rev. B 96, 035147: https://doi.org/10.1103/PhysRevB.96.035147
.. _Phys. Rev. B 101, 035144: https://doi.org/10.1103/PhysRevB.101.035144
.. _SoftwareX 21, 101266: https://doi.org/10.1016/j.softx.2022.101266
.. _Phys. Rev. B 101, 205145: https://doi.org/10.1103/PhysRevB.101.205145



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SpM-lab/sparse-ir",
    "name": "sparse-ir",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "irbasis many-body propagator svd",
    "author": "['Markus Wallerberger', 'Hiroshi Shinaoka', 'Kazuyoshi Yoshimi', 'Junya Otsuki', 'Chikano Naoya']",
    "author_email": "markus.wallerberger@tuwien.ac.at",
    "download_url": "https://files.pythonhosted.org/packages/e5/52/39b215d161948be1df0057a8960e6e11a318f8740b12dcf63a1d2ffee824/sparse-ir-1.1.0.tar.gz",
    "platform": null,
    "description": "sparse-ir - A library for the intermediate representation of propagators\n========================================================================\nThis library provides routines for constructing and working with the\nintermediate representation of correlation functions.  It provides:\n\n - on-the-fly computation of basis functions for arbitrary cutoff \u039b\n - basis functions and singular values are accurate to full precision\n - routines for sparse sampling\n\n\nInstallation\n------------\nInstall via `pip <https://pypi.org/project/sparse-ir>`_::\n\n    pip install sparse-ir[xprec]\n\nThe above line is the recommended way to install `sparse-ir`.  It automatically\ninstalls the `xprec <https://github.com/tuwien-cms/xprec>`_ package, which\nallows one to compute the IR basis functions with greater accuracy.  If you do\nnot want to do this, simply remove the string ``[xprec]`` from the above command.\n\nInstall via `conda <https://anaconda.org/spm-lab/sparse-ir>`_::\n\n    conda install -c spm-lab sparse-ir xprec\n\nOther than the optional xprec dependency, sparse-ir requires only\n`numpy <https://numpy.org/>`_ and `scipy <https://scipy.org/>`_.\n\nTo manually install the current development version, you can use the following::\n\n   # Only recommended for developers - no automatic updates!\n   git clone https://github.com/SpM-lab/sparse-ir\n   pip install -e sparse-ir/[xprec]\n\nDocumentation and tutorial\n--------------------------\nCheck out our `comprehensive tutorial`_, where we self-contained\nnotebooks for several many-body methods - GF(2), GW, Eliashberg equations,\nLichtenstein formula, FLEX, ... - are presented.\n\nRefer to the `API documentation`_ for more details on how to work\nwith the python library.\n\nThere is also a `Julia library`_ and (currently somewhat restricted)\n`Fortran library`_ available for the IR basis and sparse sampling.\n\n.. _comprehensive tutorial: https://spm-lab.github.io/sparse-ir-tutorial\n.. _API documentation: https://sparse-ir.readthedocs.io\n.. _Julia library: https://github.com/SpM-lab/SparseIR.jl\n.. _Fortran library: https://github.com/SpM-lab/sparse-ir-fortran\n\nGetting started\n---------------\nHere is a full second-order perturbation theory solver (GF(2)) in a few\nlines of Python code::\n\n    # Construct the IR basis and sparse sampling for fermionic propagators\n    import sparse_ir, numpy as np\n    basis = sparse_ir.FiniteTempBasis('F', beta=10, wmax=8, eps=1e-6)\n    stau = sparse_ir.TauSampling(basis)\n    siw = sparse_ir.MatsubaraSampling(basis, positive_only=True)\n\n    # Solve the single impurity Anderson model coupled to a bath with a\n    # semicircular states with unit half bandwidth.\n    U = 1.2\n    def rho0w(w):\n        return np.sqrt(1-w.clip(-1,1)**2) * 2/np.pi\n\n    # Compute the IR basis coefficients for the non-interacting propagator\n    rho0l = basis.v.overlap(rho0w)\n    G0l = -basis.s * rho0l\n\n    # Self-consistency loop: alternate between second-order expression for the\n    # self-energy and the Dyson equation until convergence.\n    Gl = G0l\n    Gl_prev = 0\n    while np.linalg.norm(Gl - Gl_prev) > 1e-6:\n        Gl_prev = Gl\n        Gtau = stau.evaluate(Gl)\n        Sigmatau = U**2 * Gtau**3\n        Sigmal = stau.fit(Sigmatau)\n        Sigmaiw = siw.evaluate(Sigmal)\n        G0iw = siw.evaluate(G0l)\n        Giw = 1/(1/G0iw - Sigmaiw)\n        Gl = siw.fit(Giw)\n\nYou may want to start with reading up on the `intermediate representation`_.\nIt is tied to the analytic continuation of bosonic/fermionic spectral\nfunctions from (real) frequencies to imaginary time, a transformation mediated\nby a kernel ``K``.  The kernel depends on a cutoff, which you should choose to\nbe ``lambda_ >= beta * W``, where ``beta`` is the inverse temperature and ``W``\nis the bandwidth.\n\nOne can now perform a `singular value expansion`_ on this kernel, which\ngenerates two sets of orthonormal basis functions, one set ``v[l](w)`` for\nreal frequency side ``w``, and one set ``u[l](tau)`` for the same obejct in\nimaginary (Euclidean) time ``tau``, together with a \"coupling\" strength\n``s[l]`` between the two sides.\n\nBy this construction, the imaginary time basis can be shown to be *optimal* in\nterms of compactness.\n\n.. _intermediate representation: https://arxiv.org/abs/2106.12685\n.. _singular value expansion: https://w.wiki/3poQ\n\nLicense and citation\n--------------------\nThis software is released under the MIT License.  See LICENSE.txt for details.\n\nIf you find the intermediate representation, sparse sampling, or this software\nuseful in your research, please consider citing the following papers:\n\n - Hiroshi Shinaoka et al., `Phys. Rev. B 96, 035147`_  (2017)\n - Jia Li et al., `Phys. Rev. B 101, 035144`_ (2020)\n - Markus Wallerberger et al., `SoftwareX 21, 101266`_ (2023)\n\nIf you are discussing sparse sampling in your research specifically, please\nalso consider citing an independently discovered, closely related approach, the\nMINIMAX isometry method (Merzuk Kaltak and Georg Kresse,\n`Phys. Rev. B 101, 205145`_, 2020).\n\n.. _Phys. Rev. B 96, 035147: https://doi.org/10.1103/PhysRevB.96.035147\n.. _Phys. Rev. B 101, 035144: https://doi.org/10.1103/PhysRevB.101.035144\n.. _SoftwareX 21, 101266: https://doi.org/10.1016/j.softx.2022.101266\n.. _Phys. Rev. B 101, 205145: https://doi.org/10.1103/PhysRevB.101.205145\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "intermediate representation (IR) basis for electronic propagator",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/SpM-lab/sparse-ir"
    },
    "split_keywords": [
        "irbasis",
        "many-body",
        "propagator",
        "svd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ff2df3114b0489acffa2f2e82de2f9c1636ad05410832113e24aec505b49213",
                "md5": "7b88777c3c9b957379bc673a9c7632e0",
                "sha256": "e30cce2e2c1e4cb3d8d5450c5cae1eecb94e80a381ba8c3e12621f5952f16263"
            },
            "downloads": -1,
            "filename": "sparse_ir-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b88777c3c9b957379bc673a9c7632e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 48771,
            "upload_time": "2024-03-24T08:12:49",
            "upload_time_iso_8601": "2024-03-24T08:12:49.325693Z",
            "url": "https://files.pythonhosted.org/packages/0f/f2/df3114b0489acffa2f2e82de2f9c1636ad05410832113e24aec505b49213/sparse_ir-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e55239b215d161948be1df0057a8960e6e11a318f8740b12dcf63a1d2ffee824",
                "md5": "144328330babbe9ce03a54f6e164ea83",
                "sha256": "927b88f110ad173022c324f428c7ff1f9fcd1ed093c26816d3e604e591c4bc03"
            },
            "downloads": -1,
            "filename": "sparse-ir-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "144328330babbe9ce03a54f6e164ea83",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 50664,
            "upload_time": "2024-03-24T08:12:51",
            "upload_time_iso_8601": "2024-03-24T08:12:51.345854Z",
            "url": "https://files.pythonhosted.org/packages/e5/52/39b215d161948be1df0057a8960e6e11a318f8740b12dcf63a1d2ffee824/sparse-ir-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-24 08:12:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SpM-lab",
    "github_project": "sparse-ir",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sparse-ir"
}
        
Elapsed time: 0.29073s