diff --git a/mcmc/fields/fermion/diracOperator/diracOperator.nim b/mcmc/fields/fermion/diracOperator/diracOperator.nim deleted file mode 100644 index 9e31924..0000000 --- a/mcmc/fields/fermion/diracOperator/diracOperator.nim +++ /dev/null @@ -1,67 +0,0 @@ -#[ -Author: Curtis Taylor Peterson - -Contact: curtistaylorpetersonwork@gmail.com - -Source file: mcmc/fields/fermion/diracOperator.nim - -Description: - Defines data type and constructor for generic Dirac operator - --- BEGIN LEGAL -- - -The MIT License (MIT) - -Copyright (c) 2017 James C. Osborn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - --- END LEGAL -- -]# - -import qex -import ./smearing/linkSmearing -import ../../latticeFields - -export linkSmearing - -#[ - Idea: instantiates link smearing based on actual gauge - field object (not the fields) -]# - -import diracOperatorDefinitions -import json - -type - DiracOperator*[N:static[int]] {.inheritable.} = ref object - smearing: LinkSmearing[N] - case boundaryConditionPolicy: BoundaryConditionPolicy - of StandardBoundaryConditions: - periodicity: seq[string] - -proc newDiracOperator*[N:static[int]]( - self: DiracOperator[N]; - u: seq[DComplexMatrixV[N]]; - info: JsonNode - ) = - self.smearing = u.newLinkSmearing(info) - - - diff --git a/mcmc/fields/fermion/diracOperator/diracOperatorDefinitions.nim b/mcmc/fields/fermion/diracOperator/diracOperatorDefinitions.nim deleted file mode 100644 index f66b7aa..0000000 --- a/mcmc/fields/fermion/diracOperator/diracOperatorDefinitions.nim +++ /dev/null @@ -1,55 +0,0 @@ -#[ -Author: Curtis Taylor Peterson - -Contact: curtistaylorpetersonwork@gmail.com - -Source file: mcmc/fields/fermion/diracOperator/diracOperatorDefinitions.nim - -Description: - Defines various data types and strings for generic Dirac operator - operations under mcmc/fields/fermion/diracOperator - --- BEGIN LEGAL -- - -The MIT License (MIT) - -Copyright (c) 2017 James C. Osborn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - --- END LEGAL -- -]# - -import qex -import gauge -import ../smearing/linkSmearing -import ../../latticeFields -import ../../gauge/unitary/unitaryGauge -import ../../../mcmc/mcmcErrorHandling - -export qex -export gauge -export linkSmearing -export latticeFields -export unitaryGauge -export mcmcErrorHandling - -type - BoundaryConditionPolicy* = enum - StandardBoundaryConditions \ No newline at end of file diff --git a/mcmc/fields/fermion/smearing/linkSmearing.nim b/mcmc/fields/fermion/smearing/linkSmearing.nim deleted file mode 100644 index 6c8a227..0000000 --- a/mcmc/fields/fermion/smearing/linkSmearing.nim +++ /dev/null @@ -1,214 +0,0 @@ -#[ -Author: Curtis Taylor Peterson - -Contact: curtistaylorpetersonwork@gmail.com - -Source file: mcmc/fields/fermion/linkSmearing/linkSmearing.nim - -Description: - Defines link smearing data type, constructor, and methods. - --- BEGIN LEGAL -- - -The MIT License (MIT) - -Copyright (c) 2017 James C. Osborn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - --- END LEGAL -- -]# - -import smearingDefinitions -import nhypSmearing -import stoutSmearing -import json - -type - LinkSmearing*[N:static[int]] = ref object - ## LinkSmearing object - ## Attributes: - ## nsmear: Number of smearings; applies to only stout for now - ## su: Smeared gauge field (../../latticeFields.nim) - ## u: Reference to unsmeared gauge field (../../latticeFields.nim) - ## derivative: Procedure implementing chain rule - ## Inputs: - ## f: Output of function of links - ## chain: df/dV for V the smeared link - ## smearingPolicy: SmearingPolicy specifying which - ## smearing is to be implemented - ## nhyp: Tuple containing HypCoefs nHYP container - ## and container of nHYP runtime information - ## (src/gauge/hypsmear.nim) - ## stout: Sequence of "Stout" objects - nsmear: int - su*: seq[DComplexMatrixV[N]] - u*: ref seq[DComplexMatrixV[N]] - derivative*: proc(f,chain:seq[DComplexMatrixV[N]]) - case smearingPolicy: SmearingPolicy - of HypercubicSmearing: - nhyp: tuple[parameters:HypCoefs,info:PerfInfo] - of StoutSmearing: - stout: seq[Stout[N]] - of NoSmearing: discard - -proc newLinkSmearing*[N:static[int]]( - u: seq[DComplexMatrixV[N]]; - info: JsonNode - ): LinkSmearing[N] = - ## LinkSmearing object constructor - ## Inputs: - ## u: Gauge field data type (../../latticeFields.nim) - ## info: JSON data type containing gauge field info - ## Output: - ## result: Link smearing object - - # Set policy variable and pick smearing from available options - var policy: SmearingPolicy - if not info.hasKey("smearing"): qexError SmearingError1 - case info["smearing"].getStr(): - of "nhyp","nHYP","hypercubic","Hypercubic": policy = HypercubicSmearing - of "stout","Stout": policy = StoutSmearing - of "none","NONE","na","NA","n/a","N/A": policy = NoSmearing - else: - echo SmearingError2 - throwError info["smearing"].getStr() & " is not a valid smearing option" - - # Construct link smearing object - result = LinkSmearing[N](smearingPolicy: policy) - - # Create reference to unsmeared gauge field & construct smeared - # gauge field - new(result.u) - result.u[] = u - result.su = u[0].l.newComplexGaugeLinks(N) - - # Construct smearing according to chosen smearing policy - result.nsmear = case result.smearingPolicy - of HypercubicSmearing: 1 - of StoutSmearing: - (if info.hasKey("smearing-levels"): info["smearing-levels"].getInt() else: 1) - of NoSmearing: 0 - case result.smearingPolicy: - of HypercubicSmearing: - var alph: seq[float] - case info.hasKey("smearing-coefficients"): - of true: - alph = newSeq[float]() - for alphav in info["smearing-coefficients"].getElems(): - alph.add alphav.getFloat() - of false: alph = @[0.4,0.5,0.5] # Default if not provided - result.nhyp.parameters = HypCoefs(alpha1:alph[0],alpha2:alph[1],alpha3:alph[2]) - qexLog result.smearingPolicy.instantiationLogMessage(alph,result.nsmear) - of StoutSmearing: - let rho = case info.hasKey("smearing-coefficient") - of true: info["smearing-coefficient"].getFloat() - of false: 0.1 # Default if not proided - var rhos: seq[float] - result.stout = newSeq[Stout[N]]() - case info.hasKey("smearing-coefficients"): - of true: - for elem in info["smearing-coefficients"].getElems(): - rhos.add elem.getFloat() - of false: # Default to same rho for all smears - for smear in 0.." with... - -