Skip to content
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

ot handling in lattice + composition #146

Open
3 tasks
daknuett opened this issue Feb 23, 2024 · 0 comments · May be fixed by #157
Open
3 tasks

ot handling in lattice + composition #146

daknuett opened this issue Feb 23, 2024 · 0 comments · May be fixed by #157

Comments

@daknuett
Copy link
Contributor

This is an issue to track progress of the new ot handling when composing lattices using +.

Current Status

  • g.core.expr.factor_unary is ignored by + [1]
  • Adding g.singlet lattices to int, float, complex is not supported [2]
  • Automatic or explicit embedding or projection is not supported.

Possible solutions

  • Add addition lookup table to ot_base similar to multiplication lookup table.
    • Some automatic embedding can be done, particularly complex to ot_singlet lattice.
    • Automatic embedding / projection appears dangerous.
  • Add explicit casting functions that allow for explicit embedding / projection
    • This may catch some mistakes by the user.

Notes

[1] g.core.expr.factor_unary: Reproduce as such:

grid = g.grid([8,8,8,16], g.double)
v = g.vspincolor(grid)
g(g.adj(v) + v)    # lattice(ot_vector_spin_color(4,3),double)

g((g.adj(v) + v) * v)     # GPT :    xx.xx s : Missing entry in multiplication table: ot_vector_spin_color(4,3) x ot_vector_spin_color(4,3)

g(g.adj(g.adj(v) + v) * v)     # GPT :    xx.xx s : Missing entry in multiplication table: ot_vector_spin_color(4,3) x ot_vector_spin_color(4,3)

g(g.adj(g(g.adj(v) + v)) * v)      # lattice(ot_singlet,double)

[2]

g(g.singlet(grid) + 2.0j)     # ERR: Assert term.factors.size() > 0 failed in file lib/eval.cc:199
iamprathosh added a commit to iamprathosh/gpt that referenced this issue Jan 11, 2025
Fixes lehner#146

Implement new `ot` handling in lattice `+` composition.

* Add addition lookup table to `ot_base` in `lib/gpt/core/object_type/base.py`.
* Implement automatic embedding for `complex` to `ot_singlet` lattice in `lib/gpt/core/object_type/base.py`.
* Add explicit casting functions for explicit embedding/projection in `lib/gpt/core/object_type/base.py`.
* Add unit tests for new `ot` handling in lattice `+` composition in `tests/core/expr.py`.
@iamprathosh iamprathosh linked a pull request Jan 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant