Skip to content

[BUG] Unexpected error of dimension mismatching in defining a GeneralLattice #677

@hz-xiaxz

Description

@hz-xiaxz

Describe the bug
A clear and concise description of what the bug is.
When constructing a GeneralLattice, input dismatched dimension of lattice vector and starting point gives unexpect StackOverflow error.

To Reproduce
A code snippet to reproduce the behavior

julia> GeneralLattice([(1.0,0.0,0.0),(0.0,1.0,0.0),(0.0,0.0,1.0)],[(0.0,0.0)])
ERROR: StackOverflowError:
Stacktrace:
 [1] GeneralLattice(vectors::Tuple{Tuple{…}, Tuple{…}, Tuple{…}}, sites::Tuple{Tuple{…}}) (repeats 79984 times)
   @ BloqadeLattices ~/.julia/packages/BloqadeLattices/uiRYp/src/lattice.jl:54
Some type information was truncated. Use `show(err)` to see complete types.

Expected behavior
A clear and concise description of what you expected to happen.
Check the dimension overhead and throw a dimension not match error

Screenshots
If applicable, add screenshots to help explain your problem.

Version Info

  • Julia version 1.10.4
  • Package Version (use Pkg.status() to see the version of your current environment)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions