What should we add?
The trait member CustomOperation::matrix should be fallible. Also, to_matrix is a more appropriate name for this function.
Potential Errors
- matrix exceeds the system size limit
- number of qubits is 0
to_matrix is unimplemented
Example
pub trait CustomOperation {
// Use boxed error because a generic error causes problems downstream.
fn to_matrix(&self) -> Result<Array2<Complex64>, Box<dyn error::Error>>;
}
What should we add?
The trait member
CustomOperation::matrixshould be fallible. Also,to_matrixis a more appropriate name for this function.Potential Errors
to_matrixis unimplementedExample