Add C API interface for adding a UnitaryGate
to a circuit
#14238
Labels
C API
Related to the C API
Rust
This PR or issue is related to Rust code in the repository
type: feature request
New feature or request
Milestone
What should we add?
Since #14006 merged we now have a representation of a circuit in the C API. However in that PR one component we didn't include was the function to add a
UnitaryGate
to the circuit. We can take a pointer to an array from the C caller and pass that tondarray
to create aUnitaryGate
object. Right nowUnitaryGate
only supports an owned array typeArrayType::NDArray
this could be extended to store anArrayView2
and leave the array in the caller managed memory, but doing this would have implications for lifetime tracking in the circuit so it might not be worth it. Considering we return a copy of the array whenOperation::matrix()
is called, the overhead of copying the array once from the C caller into what we put on the circuit doesn't seem like the worst tradeoff.The text was updated successfully, but these errors were encountered: