Skip to content

Stop auto-flattening and simplifying TensorProducts #126

@alexfikl

Description

@alexfikl

This happens for TensorProductShape and TensorProductSpace. Mainly, we should remove

  • The simplification in __new__ for "tensor products" with a single object.
  • The flattening in __init__.

Motivation: just tried using the code below and it got flattened to 6 PN spaces, which doesn't seem desired.

space = mp.TensorProductSpace((mp.QN(3, 5), mp.QN(1, 5), mp.QN(2, 5)))
assert len(space.bases) == 6

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions