Skip to content

Commit

Permalink
Update references, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bnicolas9 committed Feb 13, 2024
1 parent 00f646a commit 6181bea
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 139 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ If you use the implementation of the local Chern marker in periodic boundary con

N. Baù and A. Marrazzo
Local Chern marker for periodic systems
`accepted in PRB, arxiv (2023)`_
`Phys. Rev. B 109, 014206 (2024)`_

.. _accepted in PRB, arxiv (2023): https://doi.org/10.48550/arXiv.2310.15783
.. _Phys. Rev. B 109, 014206 (2024): https://doi.org/10.1103/PhysRevB.109.014206

If you use the implementation of the localization marker:

Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The functions of previous versions have been updated in order to work with this

* Introduced three main classes :python:`Model`, :python:`Supercell` and :python:`FiniteModel` which are aimed at the creation of the specific model.
* Introduced the interface with `Wannier90 <https://wannier.org/>`_ through `WannierBerri <https://wannier-berri.org/index.html>`_, which allows to read Wannier Hamiltonians.
* Introduced the PBC local Chern marker for periodic system in a supercell, as defined in Ref. `Baù-Marrazzo (2023) <https://arxiv.org/abs/2310.15783>`_.
* Introduced the PBC local Chern marker for periodic system in a supercell, as defined in Ref. `Baù-Marrazzo (2023) <https://doi.org/10.1103/PhysRevB.109.014206>`_.
* Introduced the localization marker for finite systems, as defined in Ref. `Marrazzo-Resta (2019) <https://doi.org/10.1103/PhysRevLett.122.166602>`_.
* Introduced the possibility of add disorder in the system both by an on-site uniformly distributed random term (Anderson disorder) and by vacancies in the lattice.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Welcome to StraWBerryPy!
**StraWBerryPy** (Single-poinT and local invaRiAnts for Wannier Berriologies in Python) is a Python package to calculate topological invariants and quantum-geometrical quantities in non-crystalline topological insulators.

StraWBerryPy can work with periodic and finite systems in tight-binding.
In periodic boundary conditions (PBCs), the code implements the single-point formulas for the Chern number `[Ceresoli-Resta] <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.76.012405>`_ and the single-point spin Chern number `[Favata-Marrazzo] <https://iopscience.iop.org/article/10.1088/2516-1075/acba6f/meta>`_ in the supercell framework. In PBCs, it is also possible to calculate the local Chern marker within periodic boundary conditions `[Baù-Marrazzo] <https://arxiv.org/abs/2310.15783>`_.
In periodic boundary conditions (PBCs), the code implements the single-point formulas for the Chern number `[Ceresoli-Resta] <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.76.012405>`_ and the single-point spin Chern number `[Favata-Marrazzo] <https://iopscience.iop.org/article/10.1088/2516-1075/acba6f/meta>`_ in the supercell framework. In PBCs, it is also possible to calculate the local Chern marker within periodic boundary conditions `[Baù-Marrazzo] <https://doi.org/10.1103/PhysRevB.109.014206>`_.
In addition, StraWBerryPy can handle finite systems (such as bounded samples and heterostructures) in open boundary conditions (OBCs) and can compute the local Chern marker `[Bianco-Resta] <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.241106>`_ and the localization marker `[Marrazzo-Resta] <https://doi.org/10.1103/PhysRevLett.122.166602>`_ .

The code provides dedicated interfaces to the tight-binding engines `PythTB <http://www.physics.rutgers.edu/pythtb/>`_ and `TBmodels <https://tbmodels.greschd.ch/en/latest/>`_. Latest version of StraWBerryPy implements the calculation of single-point topological invariants with ab initio Wannier Hamiltonians, which are read in the format produced by `Wannier90 <https://wannier.org/>`_ through `WannierBerri <https://wannier-berri.org/index.html>`_.
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In order to add disorder and vacancies to a given model we can use the following
model.add_onsite_disorder(w = 3, seed = rng_seed)
# Add 15 random vacancies to the lattice
vacncies = strawberrypy.utils.unique_vacancies(num = 15, Lx = model.Lx, Ly = model.Ly, basis = model.states_uc, seed = rng_seed)
vacncies = strawberrypy.utils.unique_vacancies(num = 15, Lx = model.Lx, Ly = model.Ly, basis = atoms_uc, seed = rng_seed)
model.add_vacancies(vacancies_list = vacancies)
.. note::
Expand Down Expand Up @@ -146,7 +146,7 @@ Output: ``In the pristine KM model (w = 0): SPSCN = -0.0024642975185114. In the

Topological periodic heterostructure
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As an example, we report here the code used to generate Fig. 3 of Ref. `Baù-Marrazzo(2023) <https://arxiv.org/abs/2310.15783>`_.
As an example, we report here the code used to generate Fig. 3 of Ref. `Baù-Marrazzo(2023) <https://doi.org/10.1103/PhysRevB.109.014206>`_.

.. code:: python
Expand Down Expand Up @@ -176,4 +176,4 @@ As an example, we report here the code used to generate Fig. 3 of Ref. `Baù-Mar
.. image:: _static/media/heterostructure_pbclcm.png
:width: 150%
:alt: PBC local Chern marker produced with the code above
:alt: PBC local Chern marker produced with the code above
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ repository = "https://github.com/strawberrypy-developers/strawberrypy.git"
documentation = "http://strawberrypy.readthedocs.io/"

[project.optional-dependencies]
devs = ["sphinx==6.2.1",
"sphinx-copybutton==0.5.2",
"sphinxawesome-theme==5.0.1",
"sphinx_book_theme==1.0.1",
]
devs = ["sphinx",
"sphinx-copybutton",
"sphinxawesome-theme",
"sphinx_book_theme",
]
1 change: 1 addition & 0 deletions strawberrypy/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def add_vacancies(self, vacancies_list):
self.hamiltonian = ham
self.sz = sz
self.n_occ = int(nocc)
self.n_orb = int(norbs)
self.disordered = True
self.cart_positions = cart_pos.T

Expand Down
12 changes: 6 additions & 6 deletions strawberrypy/finite_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def local_chern_marker(self, direction : int = None, start : int = 0, return_pro
raise NotImplementedError("The local Chern marker is not yet implemented for dimensionality different than 2.")

if input_projector is None:
# Eigenvectors at \Gamma
# Eigenvectors of the Hamiltonian
eigenvals, eigenvecs = la.eigh(self.hamiltonian)

# Evaluate the chemical potential
Expand Down Expand Up @@ -216,9 +216,9 @@ def localization_marker(self, direction : int = None, start : int = 0, return_pr
Returns
--------
lattice_loc :
Local Chern marker evaluated on the whole lattice if :python:`direction == None`.
Localization marker evaluated on the whole lattice if :python:`direction == None`.
loc_direction :
Local Chern marker evaluated along :python:`direction` starting from :python:`start`.
Localization marker evaluated along :python:`direction` starting from :python:`start`.
gs_projector :
Ground state projector, returned if :python:`return_projector == True`.
Expand All @@ -236,12 +236,12 @@ def localization_marker(self, direction : int = None, start : int = 0, return_pr

if direction is not None:
if direction == 0:
if start not in range(self.Ly): raise RuntimeError("Invalid start parameter (must be within [0, ny_sites - 1]).")
if start not in range(self.Ly): raise RuntimeError("Invalid start parameter (must be within [0, self.Ly - 1]).")
else:
if start not in range(self.Lx): raise RuntimeError("Invalid start parameter (must be within [0, nx_sites - 1]).")
if start not in range(self.Lx): raise RuntimeError("Invalid start parameter (must be within [0, self.Lx - 1]).")

if input_projector is None:
# Eigenvectors at \Gamma
# Eigenvectors of the Hamiltonian
_, eigenvecs = la.eigh(self.hamiltonian)

# Build the ground state projector
Expand Down
2 changes: 1 addition & 1 deletion strawberrypy/supercell.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def single_point_spin_chern(self, spin : str = 'down', formula : str = 'both', r

def pbc_local_chern_marker(self, direction : int = None, start : int = 0, return_projector : bool = False, input_projector = None, formula : str = "symmetric", macroscopic_average : bool = False, cutoff : float = 0.8, smearing_temperature : float = 0, fermidirac_cutoff : float = 0.1):
r"""
Evaluate the local Chern marker provided in Ref. `Baù-Marrazzo (2023) <https://arxiv.org/abs/2310.15783>`_ on the whole supercell if :python:`direction == None`. If ``direction`` is not :python:`None` evaluates the PBC local Chern marker along :python:`direction` starting from :python:`start`. Allowed directions are ``0`` (meaning along :math:`\mathbf{a}_1`), and ``1`` (meaning along :math:`\mathbf{a}_2`).
Evaluate the local Chern marker provided in Ref. `Baù-Marrazzo (2023) <https://doi.org/10.1103/PhysRevB.109.014206>`_ on the whole supercell if :python:`direction == None`. If ``direction`` is not :python:`None` evaluates the PBC local Chern marker along :python:`direction` starting from :python:`start`. Allowed directions are ``0`` (meaning along :math:`\mathbf{a}_1`), and ``1`` (meaning along :math:`\mathbf{a}_2`).
Parameters
----------
Expand Down
1 change: 1 addition & 0 deletions strawberrypy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def unique_vacancies(num : int, Lx : int, Ly : int, basis : int, seed : int = No

# If this is a new entry store it
if not trial_index in indexes:
indexes.append(trial_index)
unique_list.append(trial)

return unique_list
236 changes: 118 additions & 118 deletions tests/check/lcm_vacancies.check
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
-1.715568995732800861e+00
-7.159874156596552908e-01
-7.633650787073259503e-01
-2.393882001903446972e-03
-3.883907509065545605e-02
3.397070167611499492e-01
1.108000374890827366e-02
2.381304051755238349e-01
-6.916809819222982658e-02
1.150378361842168407e-01
-2.849339982295131524e-01
-6.575089900030935131e-02
-1.829717934037909388e-01
-2.048711742949170522e-01
-3.568447122415908668e-01
-2.814477783358804164e-01
-7.253102477028854356e-01
1.502811999104095540e-02
3.523425191992267391e-02
4.334971517095527194e-01
4.482139219594054591e-01
6.398211469434548215e-01
3.951138920933703891e-01
4.791094065172520344e-01
2.490378589837729251e-01
-3.055859412696724717e-02
-6.132881828443599581e-02
-2.122284570607026188e-01
-2.864055242464556006e-01
-3.050628639334039827e-01
-4.264677714593469449e-01
9.756743429535029433e-02
3.767642520108336335e-01
5.157797280879771185e-01
8.711143736689576089e-01
8.347324523722412515e-01
7.527158448136906932e-01
6.081024820103427819e-01
4.010221222727008983e-01
1.891652760605317951e-01
-4.397359517279549046e-02
-3.759623620593119941e-01
-3.723153279027169860e-01
5.672434795161340748e-02
3.633249184015479027e-01
5.070122861685796289e-01
6.303547307769267194e-01
8.472755878767789239e-01
7.493768465238586085e-01
5.961079206675466979e-01
4.839628936455556696e-01
2.293304267627933601e-01
2.240951311954231251e-01
5.914516921900749707e-02
2.192252303309984995e-01
-4.374598733671042350e-02
6.484588452624952259e-02
-1.037072667434661422e-01
-2.300182249150757585e-02
1.153988018455067016e-01
3.040011650133990218e-01
4.384676196362959910e-01
4.328822601010402504e-01
5.744850494829955023e-01
3.735290057903505878e-01
2.916574855776193353e-01
2.199579363992815173e-01
2.264102633830566702e-01
3.323492042634187404e-01
3.391545139351019311e-01
4.891123087572151751e-01
2.877567897771564631e-01
2.521104836673276339e-01
9.429414751244702408e-02
-6.154723282723455202e-02
-1.865535139505364315e-02
-6.858786466839113249e-02
-1.945055271063935928e-02
-4.783079169860444957e-02
5.224844418124401091e-02
5.714380289435141286e-02
2.450140734246113172e-01
4.895589273103311267e-01
6.074454484128334331e-01
6.742659003990880695e-01
4.732170783779893752e-01
3.030830047414659334e-01
9.194949348346442841e-02
-4.012849955101467636e-02
-3.427570363881750626e-01
-4.271649870505120905e-01
-3.689379807614555085e-01
-4.252820026101187811e-01
-2.497263311754911452e-01
5.872128266819745535e-02
1.257033318217882500e-01
4.439507164348986401e-01
3.369950112814893983e-01
3.411135808741218578e-01
7.152812209490305717e-02
-1.462744005923550259e-03
-2.684881137371855075e-01
-4.223309171898472214e-01
-7.992463848828849082e-01
-6.917432125560711853e-01
-7.014864484638563269e-01
-5.948885631342999414e-01
-2.344545542194328980e-01
-2.482210086225496437e-01
1.752350060013812064e-02
9.767253875826492626e-02
2.149383998141371488e-01
-9.712458338365655142e-02
-9.426452010735658638e-02
-4.484141518720732300e-01
-5.330188312157539965e-01
-3.388062537049405520e-01
-4.650681653145539718e-01
-1.766257111052791817e+00
-7.448394659554889996e-01
-7.829794327408923227e-01
4.433789713689292172e-02
-1.169759766820621660e-02
3.104570338428256360e-01
-2.485472361844071054e-03
1.898456620329075639e-01
-6.366713964253872815e-02
3.559260978733284897e-02
-4.520911498925271332e-01
-7.250464698983292988e-02
-2.959120154786527568e-01
-2.867740502289642945e-01
-4.869962143758166384e-01
-4.186513904585630330e-01
-7.586835700067969812e-01
6.715632588065245830e-03
2.435658867308772985e-02
3.206772575281868209e-01
3.660076579262108720e-01
4.992104851686343103e-01
3.061893078728372131e-01
3.386228767975891785e-01
1.243022881531999357e-01
6.888152300510327897e-02
1.102006096273326075e-01
-1.838332523466665869e-01
-1.580603318244170608e-01
-3.686506854292793678e-01
-5.304601775011509313e-01
6.271451568236251217e-02
1.877184903654272874e-01
3.251623867988177041e-01
6.090477385166772617e-01
6.048092102186549690e-01
6.125786706355172972e-01
6.469788798898944426e-01
5.955339103720912464e-01
6.347768423544392080e-01
5.045009096680789229e-01
2.682363574567830367e-01
-2.648459572132077500e-01
-3.495217398549029242e-01
-2.269103198968344948e-01
8.956612477488090640e-02
2.298554740484172187e-01
3.817076832195960279e-01
6.107637353414366865e-01
7.387793596084951675e-01
7.366777016553889279e-01
7.794449943985457541e-01
7.776221980268035461e-01
8.720205919385254356e-01
7.511950856426854450e-01
6.098476989641595791e-01
2.025571974020995425e-01
1.041526953501657748e-01
-1.637720058493408737e-01
-2.628605670425416263e-01
-1.621226596272834775e-01
8.100637709222187344e-02
3.814303215436213867e-01
7.061696252617064573e-01
7.464936075135569782e-01
8.807896604011551389e-01
8.617150597492660991e-01
8.694354781045414704e-01
8.214804037016263383e-01
7.330139645006978899e-01
6.621241958986813225e-01
3.770855017572182777e-01
7.133020347902423175e-02
-1.680783700040470729e-01
-3.153797474440526161e-01
-6.648045060454954580e-01
-6.535746816710023832e-02
4.036790082007882946e-02
4.882729816849446514e-01
7.052379673603096366e-01
6.854262261225398944e-01
8.024813040832541322e-01
7.380420720407107060e-01
6.547568543855640799e-01
3.571167807609861300e-01
5.597933747795307002e-02
-1.750447359281495363e-01
-3.534372143210481321e-01
-6.333375587823449893e-01
-8.157425230273988026e-01
-5.254220463206134006e-01
-3.576660110232555700e-01
1.947472190605151476e-01
1.345305391216339019e-01
4.106098705936667703e-01
2.828825463105356652e-01
4.735721057724970318e-01
1.860701420211864632e-01
1.943653796215099594e-01
-2.090757232007090238e-01
-2.584818264266798282e-01
-5.001014289936904778e-01
-5.448262557968986952e-01
-8.029508504935708446e-01
-4.721341802693683198e-01
-2.763884662197954589e-01
-2.654179961621181971e-01
7.592769833784355875e-03
-9.838565236116061929e-02
1.131465938813420724e-01
-1.622537056205965444e-01
-1.186301943907112910e-03
-4.958436033830935785e-01
-4.675972266418451095e-01
-8.952458449754296943e-01
-7.559865813752276731e-01
-4.332892688968360551e-01
-5.396592452151887098e-01
Loading

0 comments on commit 6181bea

Please sign in to comment.