Irbasis
Open-source database and software for intermediate-representation basis functions of imaginary-time Green's function
Install / Use
/learn @SpM-lab/IrbasisREADME
irbasis
Open-source database and software for intermediate-representation basis functions of imaginary-time Green's function and Python and C++ libraries
Detailed instructions are available online. Please also check our citation policy.
Below we will briefly describe this software.
Table of Contents
License
This software is released under the MIT License, see LICENSE.txt.
Structure
We briefly describe files constituting this software below.
- c++/irbasis.hpp<br>C++ library
- python/irbasis.py<br>Python library
- database/irbasis.h5<br>Database file (Lambda=10,10<sup>2</sup>, 10<sup>3</sup>, 10<sup>4</sup>, 10<sup>5</sup>, 10<sup>6</sup>, 10<sup>7</sup>).
- sample/<br> Directory including samples in C++ and Python
- test/<br>Unit tests in C++ and Python
Installation
Python
You need to install only a few standard scientific libraries (such as numpy, h5py) shown in our PyPI project page. If you install irbasis through pip, pip will take care of these dependencies properly.
We strongly recommend to install the irbasis library using the standard Python package system. This package contains the data file (irbasis.h5) as well.
python -mpip install -U pip
python -mpip install -U irbasis
Alternatively, we can put irbasis.py and irbasis.h5 into your working directory. You can load irbasis and use the full functionality.
If you want run sample Python scripts, please also install additional Python packages (scipy, matplotlib) using the following command.
pip install scipy matplotlib
C++
You need a C++03-compatible compiler. The use of the C++ irbasis library requires only the HDF5 C library (not C++).
The C++ library consists of a single header file. All what you need to do is to include irbasis.hpp in your C++ project. The data file irbasis.h5 will be read at runtime. Please do not forget to link your executable to the HDF5 C library.
Usage
In the following, we demonstrate how to use irbasis database. The irbasis database is available in Python and C++. irbasis can calculate the IR basis functions, its Fourier transform, the derivatives and corresponding singular values.
In the following, we assume that you have installed the irbasis Python library via pip. If not, please modify the sample script files appropriately to specify the location of a database file (see a comment in api.py).
Some of sample Python scripts depend on scipy and matplotlib.
For other examples, please refer to our online document.
Python
You can download api.py and save it to your working directory. Then, please run the following command.
python api.py
You can study also our step-by-step examples in a jupyter notebook.
C++
You can download api.cpp and step_by_step_examples.cpp to your working directory. After copying irbasis.hpp into the same directory, you can build the sample program as follows (see compile.sh).
g++ api.cpp -o api -I /usr/local/include -L /usr/local/lib -lhdf5 -DNDEBUG -O3
g++ step_by_step_examples.cpp -o step_by_step_examples -I /usr/local/include -L /usr/local/lib -lhdf5 -DNDEBUG -O3
Here, we assume that the header file and the library file of the HDF5 C library are installed into "/usr/local/include" and "/usr/local/lib", respectively. When running the executable, irbasis.h5 must exist in your working directory.
Related Skills
feishu-drive
337.1k|
things-mac
337.1kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
337.1kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
