Users can only choose whether to use a bounded chi or a bounded truncation_fidelity when using simulation methods from structured_state. If both are bounded by the user, an error is raised.
However, internally, both of these are set to some default value when the user does not bound them. This caused the "user error" to be raised when copying a state with truncation_fidelity bounded by the user, because the initialiser of the copy would interpret that the default value of chi was also specified by the user. The fix I went for is to check whether the value of chi is the default one, before raising the error (something that was already done for truncation_fidelity.
Checklist
[x] I have run the tests on a machine with GPUs.
[x] I have performed a self-review of my code.
[x] I have commented hard-to-understand parts of my code.
[ ] I have made corresponding changes to the public API documentation.
[ ] I have added tests that prove my fix is effective or that my feature works.
[ ] I have updated the changelog with any user-facing changes.
Description
Users can only choose whether to use a bounded
chi
or a boundedtruncation_fidelity
when using simulation methods fromstructured_state
. If both are bounded by the user, an error is raised.However, internally, both of these are set to some default value when the user does not bound them. This caused the "user error" to be raised when copying a state with
truncation_fidelity
bounded by the user, because the initialiser of the copy would interpret that the default value ofchi
was also specified by the user. The fix I went for is to check whether the value ofchi
is the default one, before raising the error (something that was already done fortruncation_fidelity
.Checklist