CQCL / pytket-cutensornet

cuTensorNet Python API extensions for pytket quantum SDK
Apache License 2.0
8 stars 1 forks source link

[bugfix] Default value of chi causes an error when state is copied #93

Closed PabloAndresCQ closed 3 months ago

PabloAndresCQ commented 3 months ago

Description

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