~x      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b cdefghijklmnopqrstuvwNone$234=KTakes the element-wise first derivative of the given vector/matrix-valued function of a single variable. The first argument gives the spacing epsilon as used in the difference formula, i.e. that thing which limit is taken to zero. The second argument is the matrix function, and the third argument is the point at which to evaluate the derivative. KThe derivative is taken using the finite difference method to second order.As , but uses fourth order finite difference method. This means that the matrix argument will need to be evaluated at twice as many points, which increases the runtime twofold until we can implement a full-gridded calculation.None$234=KETake a list of matrices, some of which may differ from the others in dimensionality by a factor of two, and maybe return the sum of these matrices with appropriate (right) kronecker products taken to make the summation well-formed. Useful for combining matrices written in forms with and without spin indices.MSend a tight-binding graph model to the corresponding Hamiltonian matrix.xxNone$234=KYIntegrate a function of n variables by giving the corresponding n integration domains, i.e. ;let f x y z = x^2 + log (y-z) integrate f (0,1) (3,4) (1,2)4This code was borrowed from the excellent answer at  lhttp://stackoverflow.com/questions/23703360/using-numeric-integration-tanhsinh-for-n-dimensional-integration.^The integration uses the Tanh-Sinh quadrature method and relies on Kmett's integration libary.yz{|}~ yz{|}~None$234=K=  !"#$%&'()*+,-./012345673  !"#$%&'()*+,-./0123456744-./0123+&*)('%$#!"  ,567-   !"#$%&*)('+,-./01234567None$234=K8Given a list of (d, a) pairs, return a mapping from the string to the value. Such a map is suitable for setting the 2 and 3 records of the - type.9Given a d, retrieve that value from the parameterization monad. If no such scalar has been uploaded to the - type, 9 with throw an error in 'TBit.Types.Parameterized'\'s  monad.:Given a d, retrieve that value from the parameterization monad. If no such scalar has been uploaded to the - type, 9 with throw an error in 'TBit.Types.Parameterized'\'s  monad.;KReturn the spacing information for purposes of gridding the Brillouin zone.< Compute a 4* quantity given a set of input parameters.=+Return a list of primitive lattice vectors.>jReturn a list of reciprocal primitive lattice vectors. They correspond in order to the return values of =, in the sense that: Sdo as <- primitiveLattice bs <- primitiveLattice return $ zipWith `dot` as bswill return the list replicate dim (2*pi)up to numerical precision. 89:;<=>89:;<=>89:;<=> 89:;<=>None$234=K?Given a list of points in k{-space, return a list of points that interpolates affine paths between them, in turn; a typical usage case might be .kPath [gammaPoint, kPoint, mPoint, gammaPoint]which is used in the \ function. The spacing between points on the interpolated path is determined by the  parameter.@Given a function defined on the Brillouin zone, evaluate it everywhere by doing nested single integrations and using Takahashi and Mori's Tanh-Sinh quadrature method. Should be robust against singularities and the like, and is properly set up for massive parallelization (via EdwardKmett's integration library, certainly not mine). Watch Dirac run this thing. Only implemented in 2D.AAs BR, but also gives the absolute error as the second value in the returned tuple.B#Integrates using a simple grid-sum.C$Returns a mesh of points within the n-parallelepiped subtended by the reciprocal lattice vectors. Covers the entire brillouin zone, though not in the shape you might expect, and not in a way that's pretty for graphing.DAs CE, but with parallelepipeds extending in each quadrant, octant... na-ant of the reciprocal lattice basis. Should cover more than the entire first Brillouin zone. ?@ABCD?@ABCDCDBA@? ?@ABCDNone$234=KEzReturns a list of eigenvectors sorted by eigenvalue. The lowest energy state is the first element of the returned list.FAs EX, but converts each vector to a column matrix for convenience in certain caclulations.GAs F,, takes the conjugate transpose of each ket.H9Returns a list of eigenvalues, sorted in ascending order.IWReturns the full eigensystem, sorted by energy. Equivalent to zipping the results of H and E.EFGHIEFGHIEGFHIEFGHINone$234=KJGiven a hamiltonian and a set of parameters, plot a real-valued function over the Brillouin zone. For a Berry curvature plot, e.g., 2bzPlot (kagomeAF, defaultParams) (bandCurvature 0)mThe output string is suitable for gnuplot, unless that string is reporting an error from the calculation.KGiven a hamiltonian and a set of parameters, plot a real-valued function over some range of a parameter. For a Chern number plot over the hopping parameter, e.g., FparamPlot (kagomeAF, defaultParams) (chern 1) ("t", [1.0, 1.1 .. 5.0])mThe output string is suitable for gnuplot, unless that string is reporting an error from the calculation.LGiven a hamiltonian and a set of parameters, plot the bands over a path anchored by the provided wavevectors. For instance, gamma = vector [0.0 , 0.0] point1 = vector [0.5 , 1.0] point2 = vector [0.5 , -1.0] bandPlot (kagomeAF, defaultParams) [gamma, point1, point2, gamma]mThe output string is suitable for gnuplot, unless that string is reporting an error from the calculation.JKLJKLJKLJKL None$234=KMCalculate the Berry curvature of a single band, which is to be given indexed from zero (i.e. to calculate the lowest band, pass in 0 for the $9. Uses the five-point stencil method for differentiation.N Calculate the total Berry curvature of a the occupied bands, which are specified by passing in the number of filled bands as the first argument. For example, to find the curvature due to occupied bands of a 4 band system at half-filling, pass in 2 for the $<. Uses the five-point stencil method for differentiation.O Deprecated?P Deprecated?MNOPMNOPMNOPMNOP None$234=KQCalculate the Chern number of the nth band (indexed from 0) by integrating the Berry curvature over the Brillouin zone. The $% parameter is passed directly to MB, and should use the same conventions for specifying the band.The output is appropriately normalized by 1/2. The integration is carried out using the TanhSinh quadrature method via .SCalculate the Chern number of the first n occupied bands by using a grid of closed loops and calculating many Berry phases using the discretized formula. This function is  guaranteed to return an integer result by rounding the actual calculation. It tries to determine if the Chern number is undefined due to a degeneracy, and if it is then it throws an error via the  monad transformer.QRSQRSSRQQRS None$234=KTKReturns the total orbital magnetization due to filling the first n bands.UReturns the gauge-invariant self-rotational orbital magnetization, i.e. the circular dichroism, of the occupied bands, accomplished by integrating X.V4Returns the intrinsic orbital magnetization of the nth@ band, namely the integral of _m_(k) from (Xiao et al., 2005).WSums V over the first n bands.X;Essentially equation (12) from PRB _77_, 054438 (2008) with alpha, beta set to x, y respectively so as to give the z-component of the (expectation value of) the circular dichroism pseudovector. This form takes a double sum over occupied and then unoccupied states, which improves over the implementation of Yj by allowing for intra-(un)occupied band degeneracies as long as there is still an electronic band gap.CAs is consistent with our API for these types of functions, the #M argument should be a positive integer counting the number of filled bands.YGives the gauge-invariant self-rotational orbital magnetism, which is proportional to the circular dichroism for a particular band index. This is m(k) in Xiao et al's semiclassical approach (hence the name).The full orbital magnetization for a particular wavevector; integrating over the Brillouin zone would give the actual OM due to a particular band filling.TUVWXYTUVWXYTUXWYVTUVWXY None$234=KZZZZ None$234=K[\]^_`ab[\]^_`a[\]^b_`a[\]^_`abNone$234=Kc0Add nearest-neighbor hopping to a lattice model.d-Add an onsite energy term to a lattice model.eAdd an staggered onsite term to a lattice model. Works based on the integer parity of graph nodes, making it model-detail-dependent.fKProduces a representation of local magnetic moments given by site-wise  5 data. Fails clumsily if applied to Scalar sites.gPProduces a Rashba spin-orbit coupling term for an E-field applied along the z direction. hUProduces a spin-orbit interaction in the style of that given by Hua et al in PRL 112K, 017205 (2014). It should probably only be used with a Kagom lattice 5. It works by looking at nearest neighbor pairs (i,j) and then looking up the   moment of site k; k is computed as ik = let i' = succ $ (i - 1) `mod` 3 j' = succ $ (j - 1) `mod` 3 in head $ [1,2,3] \\ [i',j'] (Recall that i and jr are indexed from 1 as nodes.) Clearly, this function is not safe unless it's applied to the correct lattice.Once   is computed for   kq, it is coupled to the Pauli matrix tensor as expected. The parity &nu; is chosen by asking whether succ i == j mod 3. cdefghcdefghcdefhg cdefghre-exports useful functions(c) Matthew Daniels, 2014New BSDdanielsmw@gmail.com experimentalNone$234=K?EHJKLMNQSTVWZ[\]^_cdefgSQMNTWVZEH\]^_[cdefgJKL?None$234=Ki(The default set of scalar parameters is:"t" = 1, the hopping parameter,"tSO" = 1, the intrinsic spin-orbit couplingJ' = 1, the Heisenberg exchange parameterThe default vector parameters are the d-orbital local moments on the three sites. Each of them takes the form: (-cos theta, -sin theta, 0) where theta is:"d0" : theta = pi/2"d1" : theta = pi2 + 2pi3"d2" : theta = pi2 + 4pi3These can be changed by using j! to set all of them explicitly.j^Set the named parameters to their given complex values. This function is used to implement i as <defaultParams = parameters [ ("t" , 1.0 :+ 0.0) , ("tSO", 0.2 :+ 0.0) , ("J" , 1.7 :+ 0.0) ] [ ("d0" , n21 ) , ("d1" , n02 ) , ("d2" , n10 ) ] where n10 = negate $ fromList [ cos ang01 , sin ang01 , 0.0 ] n21 = negate $ fromList [ cos ang12 , sin ang12 , 0.0 ] n02 = negate $ fromList [ cos ang20 , sin ang20 , 0.0 ] ang01 = pi/2.0 + 4.0*pi/3.0 ang12 = pi/2.0 ang20 = pi/2.0 + 2.0*pi/3.0but you can use it to generate your own parameter list. For more advanced manipulation, like setting the mesh size or the primitive lattice vectors, you'll have to constuct a  type explicitly.kThe kagom hamiltonian provided here includes nearest-neighbor hopping, noncollinear AF order due to localized d-orbital moments, and spin-orbit coupling which breaks mirror symmetry.ijkijkijkijkNone$234=Kl(The default set of scalar parameters is:"t" = 1, the hopping parameter,"soc" = 1, the intrinsic spin-orbit coupling'"r" = 1, the Rashba spin-orbit coupling%"v" = 1, the staggered on-site energy'"hz" = 1, the out-of-plane AF parameterThese can be changed by using m! to set all of them explicitly.m^Set the named parameters to their given complex values. This function is used to implement l as defaultParams = parameters [ ("t" , 1.0 :+ 0.0) , ("soc", 1.0 :+ 0.0) , ("r" , 1.0 :+ 0.0) , ("v" , 1.0 :+ 0.0) , ("hz" , 1.0 :+ 0.0) ]but you can use it to generate your own parameter list. For more advanced manipulation, like setting the mesh size or the primitive lattice vectors, you'll have to constuct a  type explicitly.nExported directly from a Mathematica and hard-coded into this module. Uses the exact conventions of Kane Mele, excep that the Gamma_15 term also includes a constant value for AF order. This AF order is taken in the large Hubbard U limit by construction.lmnlmnlnmlmnNone$234=Kopopopop(calculate spin-orbit and other spillages(c) Matthew Daniels, 2014New BSDdanielsmw@gmail.com experimentalNone$234=KqqqqNone$234=Kr Sets the / field of the - state according to a s.s*Determine a primitive lattice for a given .FThis is currently accomplished by determining the diameter of the thegraph, collecting all non-zero displacements from an arbitary site to itself which are within a diameter's worth of NN hopping, and returning a maximal linearly independent subset of these with a preference for vectors with smaller L2 norms.6For finite nanoribbons such as those generated by , the graph diameter can be quite large. This means that finding the primitive lattice vectors as described above can become unreasonably slow. In the future, we will label decompactified lattice vectors in the CellGraph so that # will understand not to count them.tDelete a list of s from a graph. u Replicate a { n times, each time increasing the in and out nodes by m. (n is the first argument, m the second, somewhat stupidly.)v Replicate a X n times, each time increasing the in and out nodes by the number of nodes in the . rstuvrstuvsrtuv rstuvNone$234=Kw6Perform so-called "truncated decompactification" on a .Since the neighbor-data is stored in a unit-cell-level graph, it's in a sense "compact", i.e. it's a local periodic structure instead of an extended (to infinity) structure. Truncated decompactification sends the periodic structure (on T^2, roughly speaking) back to something of infinite extent (i.e. the integers), but then truncates the result to keep only a finite subset (i.e. the ribbon-width).It may not be clear a priori( how to choose the edge you want to wm on to get the desired edge configuration; for honeycomb, you can show on paper that decompactifying on a single graph edge (there are three, corresponding to the three nearest neighbors of a site) gives you zig-zag edge, while decompactifying on two graph edges gives you an armchair configuration. The square lattice is even more straightforward.wwww !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef g h i j k l m n o p q r s t u v w x y z { |}~  TBit-0.4.2.2TBit.Numerical.Derivative&TBit.Hamiltonian.Builder.MatrificationTBit.Numerical.Integration TBit.TypesTBit.ParameterizationTBit.FrameworkTBit.Hamiltonian.Eigenstates TBit.PlotsTBit.Topological.CurvatureTBit.Topological.Chern"TBit.Magnetic.OrbitalMagnetizationTBit.Electronic.Conductance!TBit.Hamiltonian.Builder.ExamplesTBit.Hamiltonian.Builder.TermsTBit.Systems.KagomeLatticeTBit.Systems.HoneycombLatticeTBit.Systems.SquareLatticeTBit.Topological.Spillage)TBit.Hamiltonian.Builder.PrimitiveLattice+TBit.Hamiltonian.Builder.DecompactificationPlotsbandPlotTypes meshingData integrateControl.Monad.ExceptExceptT TBit.Toolbox Parameters decompactifydiffdiff4mixedSumtoMatrix AdjMatrix CellGraph DisplacementParameterizableSiteData VectorSitemom ScalarSitenumSOCRashbaOnSiteHoppingAFOrderEigenketEigenbra EigenstateEnergy ChemEnergyMoment Magnetization HamiltonianKPath Curvature WavevectorChern GridIndexGIDMeshingSpacingFilling BandIndexGridTBErrorUnknownParameterUndefinedErrorDimensionalityErrorSingularLatticeErrorLatticeTerm latticeData decomData scalarParams vectorParams ParameterizedsigmaXsigmaYsigmaZ loadParams getScalar getVectorgetMeshcrunchprimitiveLatticerecipPrimitiveLatticekPath bzIntegral'' bzIntegral' bzIntegralmeshBZ meshBigBZ eigenstates eigenkets eigenbras eigenenergies eigensystembzPlot paramPlot bandCurvatureoccupiedCurvaturecurvatureFieldBandcurvatureFieldOcc chernBandchernRawchernorbMag dichroismbandIntrinsicOM intrinsicOMdichroicIntegrand integrandMknernstConductivityring squareLattice hexLattice kagomeLattice kagomeRibbon kagomeRibbon' hermitize $fMonoidg neighborTerm onsiteTermparityStaggeredTerm localMomentsrashbaZ kagomeSOC defaultParams parameterskagomeAFkaneMelehgteHamiltonianspillagesetPrimLattice primLattice delLEdges replicateE replicateGmixedAdd CurryBoundsCurried curryBounds IntegrableBounds integrate'BoundResttrap$fCurryBounds(,)$fCurryBounds()$fIntegrable(->)$fIntegrableDoublePosition$fNFDataTBError$fFunctor(,,,)$fFoldable(,,,)$fTraversable(,,,) $fFunctor(,,)$fFoldable(,,)$fTraversable(,,)$fNFDataParameters$fNFDataMeshingbaseGHC.BaseStringtransformers-0.4.3.0Control.Monad.Trans.Except realScalar complexScalarmakeAxismakeDoubleAxispopulateenergies eigensystem' computeBZPlot computePMPlot multiPlotbandDatawaveGrid safelyTake curvature phaseDiff integrandOMnernstIntegrandnernstIntegrand'nthNeighborsTobranch restrictorhoppingafOrder spinOrbit spillMatrix graphDiameter fgl-5.5.1.0Data.Graph.Inductive.GraphLEdge bulkCyclesrecordDecomEdges+++