forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rust friendly
assign parameters
methods (Qiskit#12913)
* Initial: Add `assign_parameter` methods that can be used from Rust. * Add: Error message in `from_slice` method. - Accept owned mapping for `from_mapping`. * Fix: Use `assign_parameters_from_slice` as inner method for `assign_parameters_sequence` * Fix: Use `ParameterUuid` as keys for `assign_parameter_from_mapping` * Fix: Accept Param references in `assign_parameters_inner` * Fix: Ownership issues - Remove initial allocation of `Param` instances within a vec in `assign_parameters_iterable`. - Revert changes in `assign_parameters_mapping`. - Fix error message in `assign_parameter_from_slice`. - Return an error if a `uuid` is not found in `assign_parameters from mapping. Also, return error if a valid uuid is not found to avoid panicking. - Add `clone_ref(py)` method to `Param` to ensure that we use the most efficient cloning methods (either `clone_ref` with gil or copying). - Implement trait `AsRef<Param>` for `Param` to be able to send both owned and non-owned instances to `assign_parameters_inner`. * Docs: Add comment on `AsRef<Param>` impl block.
- Loading branch information
Showing
2 changed files
with
88 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters