Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix: Cannot initialize
ParticleConservingU1/2
with default `init…
…_state` (#5535) **Context:** `qml.ParticleConservingU1` and `qml.ParticleConservingU2` cannot be initialized with their default value for the `initial_state` argument (the default value is `None`). **Description of the Change:** If the `initial_state` argument is not specified, it is set to a tuple of zeros, which seems a reasonable choice for an initial state in physics. This modification occurs only if the initial state is not specified and the information is reported in the class's docstring. **Benefits:** The error is no longer raised when the initial state is not specified, and the class works with the default argument. **Possible Drawbacks:** As mentioned above, this modification only occurs if the initial state is not specified and should not cause any issues. **Related GitHub Issues:** #5522 [sc-61431]
- Loading branch information