Apple silicon M1 for the many-body physicist

conda config --add channels conda-forge 
conda config --set channel_priority strict
conda create -n MY-ENV python=3.9 pybind11 cython=0.29.30
pip3 install --no-binary :all: numpy
python3
import numpy
numpy.show_config()
conda config --set pip_interop_enabled true
echo "numpy=1.23.0=pypi*" >> ~/opt/anaconda3/envs/MY-ENV/conda-meta/pinned
conda install scipy

Comments

pip3 install --no-binary :all: numpy==1.22.4 --force-reinstall

Let’s do many-body physics: QuSpin for exact diagonalisation

conda install joblib six dill gmpy2 numexpr boost llvm-openmp numba=0.55.2 openmpi-mpicc
Git clone https://github.com/weinbe58/QuSpin.git
python setup.py install --omp --record install_file.txt
which clang
mv clang arm64-apple-darwin20.0.0-clang
mv clang++ arm64-apple-darwin20.0.0-clang++

Alternative — compile with g++

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gcc
brew install g++
export CC=gcc-11
export CXX=g++-11
export CFLAGS=”-I/opt/homebrew/include”
python setup.py install — omp — default-compiler-flags — record install_file.txt

Get the matrix product states to work — TeNPy

git clone https://github.com/tenpy/tenpy.git $HOME/TeNPy
cd $HOME/TeNPy
vim ~/.bashrc
export PYTHONPATH=$HOME/TeNPy
bash ./compile.sh

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Schuckert

Alex Schuckert

Trying to make sense of quantum physics with the help of green tea.