Merge 251113#1683
Closed
mankai-chow wants to merge 10 commits into
Closed
Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/ext/ITensorsHDF5Ext/qn.jl b/ext/ITensorsHDF5Ext/qn.jl
index 4282f1611..d756082c1 100644
--- a/ext/ITensorsHDF5Ext/qn.jl
+++ b/ext/ITensorsHDF5Ext/qn.jl
@@ -13,20 +13,20 @@ function HDF5.write(parent::Union{HDF5.File, HDF5.Group}, gname::AbstractString,
return write(g, "mods", mods)
end
-function HDF5.read(parent::Union{HDF5.File,HDF5.Group}, name::AbstractString, ::Type{QN})
- g = open_group(parent, name)
- if read(attributes(g)["type"]) != "QN"
- error("HDF5 group or file does not contain QN data")
- end
- names = read(g, "names")
- vals = read(g, "vals")
- mods = read(g, "mods")
- nemptyQN = maxQNs - length(names)
- if (nemptyQN > 0)
- append!(names, fill("", nemptyQN))
- append!(vals, fill(0, nemptyQN))
- append!(mods, fill(0, nemptyQN))
- end
- mqn = ntuple(n -> QNVal(names[n], vals[n], mods[n]), maxQNs)
- return QN(mqn)
+function HDF5.read(parent::Union{HDF5.File, HDF5.Group}, name::AbstractString, ::Type{QN})
+ g = open_group(parent, name)
+ if read(attributes(g)["type"]) != "QN"
+ error("HDF5 group or file does not contain QN data")
+ end
+ names = read(g, "names")
+ vals = read(g, "vals")
+ mods = read(g, "mods")
+ nemptyQN = maxQNs - length(names)
+ if (nemptyQN > 0)
+ append!(names, fill("", nemptyQN))
+ append!(vals, fill(0, nemptyQN))
+ append!(mods, fill(0, nemptyQN))
+ end
+ mqn = ntuple(n -> QNVal(names[n], vals[n], mods[n]), maxQNs)
+ return QN(mqn)
end
diff --git a/src/lib/QuantumNumbers/src/qn.jl b/src/lib/QuantumNumbers/src/qn.jl
index e91631c78..4eb347ae4 100644
--- a/src/lib/QuantumNumbers/src/qn.jl
+++ b/src/lib/QuantumNumbers/src/qn.jl
@@ -4,8 +4,8 @@ using ..SmallStrings: SmallString
using StaticArrays: MVector, SVector
const maxQNs = 10
-const QNStorage = SVector{maxQNs,QNVal}
-const MQNStorage = MVector{maxQNs,QNVal}
+const QNStorage = SVector{maxQNs, QNVal}
+const MQNStorage = MVector{maxQNs, QNVal}
"""
A QN object stores a collection of up to four |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #(issue)
If practical and applicable, please include a minimal demonstration of the previous behavior and new behavior below.
Minimal demonstration of previous behavior
Minimal demonstration of new behavior
How Has This Been Tested?
Please add tests that verify your changes to a file in the
testdirectory.Please give a summary of the tests that you added to verify your changes.
Checklist:
using JuliaFormatter; format(".")in the base directory of the repository (~/.julia/dev/ITensors) to format your code according to our style guidelines.