-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Honeycomb and hexagonal geometries #305
base: develop
Are you sure you want to change the base?
Conversation
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
Architecture: x86_64
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
Architecture: x86_64
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
Architecture: x86_64
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Rimu.jl/Rimu.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
Architecture: x86_64
|
Pull Request Test Coverage Report for Build 12896615852Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome new features - thanks!
The documentation still needs a bit of love
cartesian vector indices (tuples or `SVector`s) and linear indices (integers). When indexed | ||
with vectors, it folds them back into the grid if the out-of-bounds dimension is periodic and | ||
0 otherwise (see example below). | ||
## Interface: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before defining the interface it would be good to say what it is useful for, i.e. to define a geometry and pass it to HubbardRealSpace
with the geometry
keyword. Next I would suggest to mention and link the concrete implementation (i.e. what a user wants to know).
The information about the Interface is valuable but should come last as it is relevant for developers or power users only. Alternatively it could be hidden behind # Extended help
.
I find the example rather confusing. Here it would be better to have an example where an instance is created and passed into a hamiltonian, maybe?
constructing a [`HubbardRealSpace`](@ref). The type instance can be used to convert between | ||
cartesian vector indices (tuples or `SVector`s) and linear indices (integers). When indexed | ||
with vectors, it folds them back into the grid if the out-of-bounds dimension is periodic and | ||
0 otherwise (see example below). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we reference an example but none follows. The example now part of the Geometry
docstring might make sense here.
end | ||
|
||
""" | ||
CubicGrid(dims::NTuple{D,Int}, fold::NTuple{D,Bool}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CubicGrid(dims::NTuple{D,Int}, fold::NTuple{D,Bool}) | |
CubicGrid(dims::NTuple{D,Int}, fold::NTuple{D,Bool}) <: Geometry{D} |
[`LadderBoundaries`](@ref) for special-case constructors and [`HoneycombLattice`](@ref), and | ||
[`HexagonalLattice`](@ref) for alternative lattice geometries. | ||
|
||
See also [`HubbardRealSpace`](@ref) and [`G2RealSpace`](@ref). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also [`HubbardRealSpace`](@ref) and [`G2RealSpace`](@ref). | |
See also [`Geometry`](@ref), [`HubbardRealSpace`](@ref) and [`G2RealSpace`](@ref). |
|
||
See also [`HubbardRealSpace`](@ref) and [`G2RealSpace`](@ref). | ||
|
||
A 3×2 `CubicGrid` is indexed as follows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example would still be good.
""" | ||
neighbor_site(::Geometry, site, i) | ||
|
||
Find the `i`-th neighbor of `site` in the geometry. If the move is illegal, return 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find the `i`-th neighbor of `site` in the geometry. If the move is illegal, return 0. | |
Find the `i`-th neighbor of `site` in the geometry. If the move is illegal, return 0. | |
See also [`Geometry`](@ref). |
""" | ||
num_dimensions(geom::Geometry) | ||
|
||
Return the number of dimensions of the lattice in this geometry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return the number of dimensions of the lattice in this geometry. | |
Return the number of dimensions of the lattice in this [`Geometry`](@ref). |
Use the [`Geometry`](@ref) to fold the `vec` in each dimension. If folding is disabled in a | ||
dimension, the vector is allowed to go out of bounds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confuses me a bit. What does it mean to fold?
Is the following interpretation accurate?
Use the [`Geometry`](@ref) to fold the `vec` in each dimension. If folding is disabled in a | |
dimension, the vector is allowed to go out of bounds. | |
Use the [`Geometry`](@ref) to fold the `vec` in each dimension back into the bounded domain. | |
If folding is disabled in a dimension, the vector is unchanged and allowed to go out of bounds. |
function BitStringAddresses.onr(address, geom::CubicGrid{<:Any,S}) where {S} | ||
return SArray{Tuple{S...}}(onr(address)) | ||
end | ||
function BitStringAddresses.onr(address::CompositeFS, geom::CubicGrid) | ||
return map(fs -> onr(fs, geom), address.components) | ||
end | ||
|
||
""" | ||
HoneycombLattice((height, width), fold=(true, true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HoneycombLattice((height, width), fold=(true, true)) | |
HoneycombLattice((height, width), fold=(true, true)) <: Geometry{2} |
A link back to Geometry
would be helpful.
num_neighbors(::HoneycombLattice) = 3 | ||
|
||
""" | ||
HexagonalLattice((height, width), fold=(true, true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HexagonalLattice((height, width), fold=(true, true)) | |
HexagonalLattice((height, width), fold=(true, true)) <: Geometry{2} |
Again, please link back to Geometry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HexagonalLattice((height, width), fold=(true, true)) | |
HexagonalLattice(height, width, fold=(true, true)) <: Geometry{2} |
Should we drop the parenthesis to make it consistent with the show
method?
I'm wondering why Coveralls is reporting all these new missed lines in code that is not touched by this PR?? |
Changes
HoneycombLattice
andHexagonalLattice
.Geometry
, which is a supertype ofCubicGrid
and the new lattice types.Bugfix
LatticeBoundaries
.