Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: thchr
  • License: mit
  • Language: Julia
  • Default Branch: master
  • Size: 161 KB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Created about 5 years ago · Last pushed 12 months ago
Metadata Files
Readme License Citation

README.md

MPBUtils

MPBUtils.jl interfaces with Crystalline.jl to set up and post-process mpb (MIT Photonic Bands) calculations of band connectivity and topology of photonic crystals using symmetry indicators (also known as topological quantum chemistry).

Installation

This package is not presently registered (and may well change its name in the future). To install it, go to Julia's pkg> prompt (by pressing ]) and type: jl pkg> dev https://github.com/thchr/MPBUtils.jl SymmetryBases.jl is a dependency of MPBUtils.jl (which also not registered); by deving (rather than adding), it will also be automatically installed.

Functionality

The package at present contains two sets of distinct utilities:

  1. Utilities to facilitate the symmetry-based topological analysis of photonic crystals, relying on tools in Crystalline.jl in combination with mpb's ability to compute the symmetry eigenvalues of the photonic band structure.
  2. Exportation and importation of Guile parseable job scripts for mpb's .ctl interface. This utility is subject to future removal as its effective use requires .ctl files that are not included in this repository.

We describe the utilities in point 1 by example below.

Examples

2D photonic crystal

MPBUtils.jl provides a set of convenience tools to initialize and process symmetry analyses of photonic crystal band structures, aimed at making this possible in an interactive manner via mpb's python interface (called from Julia via PythonCall.jl). To illustrate the functionality, we will first consider a simple 2D photonic crystal example.

First, we make the mpb python interface accessible via Julia and also load the Crystalline.jl and MPBUtils.jl packages: ```jl

--- load relevant packages ---

using Crystalline using MPBUtils `` Note that loading MPBUtils also automatically loads (and installs, via CondaPkg.jl and PythonCall.jl) [mpb](https://github.com/NanoComp/mpb) (exported asmpb) and meep [meep](https://github.com/NanoComp/meep) (exported asmp`).

Then we initialize a 2D photonic crystal calculation: ```jl

--- mpb: geometry & solver initialization ---

ms = mpb.ModeSolver( numbands = 10, resolution = 32, geometrylattice = mp.Lattice(size=[1,1]), geometry = pylist([mp.Block(center=[0,0], size=[0.3,0.3], # a 15° rotated square material=mp.Medium(epsilon=16), e1=[cosd(15),sind(15)], e2=[cosd(105),sind(105)])]) ) ms.initparams(p = mp.TM, resetfields=true) # solve for TM modes ```

This structure has the symmetry of plane group 10 (p4). In preparation for the following steps, we first obtain relevant group theory related data for this plane group via Crystalline.jl: ```jl

--- band representations, littlegroups, & irreps ---

D, sgnum = 2, 10 # dimension and plane group (p4, with Z₂ indicator group) brs = primitivize(calc_bandreps(sgnum, Val(D))) # elementary band representations lgirsv = irreps(brs) # small irreps & little groups assoc. w/ brs ```

We take care above to convert the internally referenced little groups of brs to a primitive setting (via primitivize), since calc_bandreps (and indeed, all other accessors in Crystalline) by default returns operations in a conventional setting; when we consider the symmetry eigenvalues, however, we must work in a primitive setting since our computational unit cell also will be a primitive one. That is, the operations and k-points used when calculating symmetry eigenvalues must refer to the same setting as used in the associated unit cell; to avoid redundant band folding, this should be a primitive unit cell. The reduction step is actually redundant in plane group 10 (p4), as its conventional setting is already primitive. However, we stress it here to emphasize that this is necessary in the general case (for centered Bravais lattices).

Next, using mpb, we compute the relevant symmetry eigenvalues of the photonic band structure at each of the k-points featured in brs and lgirsv: ```jl

--- compute band symmetry data ---

symmetry eigenvalues ⟨Eₙₖ|gᵢDₙₖ⟩, indexed over k-labels klab, band indices n, and

operations gᵢ (index i)

symeigsv = computesymmetryeigenvalues(ms, lgirsv, :TM) ```

Because the photonic band structure is singular at zero frequency, mpb will not generally be able to assign the appropriate symmetry eigenvalue at (k = Γ, ω = 0). To correct for this, compute_symmetry_eigenvalues must calls MPBUtil.jl's fixup_gamma_symmetry! on the MPB-returned symmetry eigenvalue data before returning. In 2D, this requires that we specify the polarization (:TE or :TM), because this correction is polarization-dependent. In 3D, the correction can be made solely on the basis of the space group.

Finally, we use the band representations (and little group irreps implicitly referenced by them) to analyze the symmetry eigenvalue data symeigsv, extracting the associated band connectivity and band topology of the separable bands in our calculation: ```jl

--- analyze connectivity and topology of symmetry data ---

summaries = collectcompatibledetailed(symeigsv, brs) ```

For the above structure, this returns the following vector of BandSummarys: jl julia> summaries 5-element Vector{BandSummary{2}}: [X₁, M₁, Γ₁] (1 band) trivial [3X₂, M₂+M₃M₄, Γ₁+Γ₃Γ₄] (3 bands) trivial [2X₁, M₃M₄, 2Γ₂] (2 bands) fragile [X₁, M₂, Γ₁] (1 band) nontrivial [X₁+X₂, M₁+M₂, Γ₃Γ₄] (2 bands) trivial

Each band summary contains detailed information about the associated photonic bands. We can e.g., inspect the 4th band grouping in more detail: jl julia> summaries[4] 1-band BandSummary{2}: bands: 7:7 n: [X₁, M₂, Γ₁] (1 band) topology: nontrivial indicators: 1 ∈ Z₂

Adjacent bands can be "stacked" by addition. E.g., to evaluate the topology of the first three band groupings, we can evaluate: jl julia> summaries[1] + summaries[2] + summaries[3] # or simply, sum(summaries[1:3]) 6-band BandSummary: bands: 1:6 n: 3X₁+3X₂, M₁+M₂+2M₃M₄, 2Γ₁+2Γ₂+Γ₃Γ₄ topology: trivial From which we see that the fragile bands in the 3rd band grouping are trivialized by the trivial bands in the 1st and 2nd band groupings.

3D photonic crystal

Analysis of 3D photonic crystals proceeds similarly. As an example, the following scripts sets up a photonic crystal calculation with the symmetry of space group 81 (P-4) and analyses its band connectivity and topology from symmetry (execution should take on the order of 10-20 seconds):

```jl

--- load relevant packages ---

using Crystalline using MPBUtils

--- mpb: geometry & solver initialization ---

r = 0.15 mat = mp.Medium(epsilon=12) ms = mpb.ModeSolver( numbands = 20, geometrylattice = mp.Lattice(basis1=[1,0,0], basis2=[0,1,0], basis3=[0,0,1], basissize=[1,1,1]), geometry = pylist([ mp.Sphere(center=[0.35,0.1,-.2], radius=r, material=mat), mp.Sphere(center=[-0.1,0.35,.2], radius=r, material=mat), mp.Sphere(center=[-0.35,-0.1,-.2], radius=r, material=mat), mp.Sphere(center=[0.1,-0.35,.2], radius=r, material=mat)]), resolution = 16 ) ms.initparams(p=mp.ALL, reset_fields=true)

--- band representations, littlegroups, & irreps ---

D, sgnum = 3, 81 # P-4 (Z₂×Z₂ symmetry indicator group) brs = primitivize(calc_bandreps(sgnum, Val(D))) # elementary band representations lgirsv = irreps(brs) # associated little groups & small irreps

--- compute band symmetry data ---

symeigsv = computesymmetryeigenvalues(ms, lgirsv) # symmetry eigenvalues ⟨Eₙₖ|gᵢDₙₖ⟩

--- analyze connectivity and topology of symmetry data ---

summaries = collectcompatibledetailed(symeigsv, brs) ```

Producing the result: jl julia> summaries 5-element Vector{BandSummary{3}}: [Z₃Z₄, M₁+M₂, A₁+A₂, X₁+X₂, -Γ₁+Γ₂+Γ₃Γ₄, R₁+R₂] (2 bands) nontrivial [Z₃Z₄, M₃M₄, A₃A₄, X₁+X₂, Γ₃Γ₄, R₁+R₂] (2 bands) nontrivial [Z₁+Z₂+Z₃Z₄, M₁+M₂+M₃M₄, A₁+A₂+A₃A₄, 2X₁+2X₂, Γ₁+Γ₂+Γ₃Γ₄, 2R₁+2R₂] (4 bands) trivial [Z₂+Z₃Z₄, M₁+2M₂, 2A₁+A₂, X₁+2X₂, Γ₂+Γ₃Γ₄, R₁+2R₂] (3 bands) nontrivial [Z₁+Z₃Z₄, M₁+M₃M₄, A₂+A₃A₄, 2X₁+X₂, Γ₁+Γ₃Γ₄, 2R₁+R₂] (3 bands) nontrivial

Collaboration and how to cite

Please consider reaching out to us directly if you find the included functionality interesting. See also the papers below, for which the tools were developed:

Owner

  • Name: Thomas Christensen
  • Login: thchr
  • Kind: user
  • Company: Massachusetts Institute of Technology (MIT)

Citation (CITATION.cff)

cff-version: 1.2.0
message: "Citation:"
authors:
- family-names: "Christensen"
  given-names: "Thomas"
- family-names: "Ali"
  given-names: "Ghorashi"
title: "MPBUtils.jl"
license: "MIT"
date-released: 2023-06-06
url: "https://github.com/thchr/MPBUtils.jl"

GitHub Events

Total
  • Issues event: 1
  • Watch event: 2
  • Issue comment event: 1
  • Push event: 6
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 2
  • Issue comment event: 1
  • Push event: 6
  • Create event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 11
  • Total pull requests: 26
  • Average time to close issues: 24 days
  • Average time to close pull requests: 2 days
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 3.64
  • Average comments per pull request: 2.15
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • samuelkim314 (3)
  • thchr (2)
  • vg137 (1)
Pull Request Authors
  • AliGhorashiCMT (10)
  • thchr (3)
  • samuelkim314 (3)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/CI.yml.deactivated actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite