[−][src]Trait dqcsim::common::converter::MatrixConverter
A type that represents a possibly parameterized matrix form, allowing conversion between the parameters and the complete matrix.
Converter<(Matrix, f64, bool), Self::Parameters>
is automatically
implemented for types with this trait.
Associated Types
type Parameters
For parameterized matrices, this is the type of the parameters needed
for construction/returned by detection. FromArb
and ToArb
must
typically be defined for it
Required methods
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
Detects whether the given matrix has a recognized form and returns the parameters that can be used to reconstruct it, within the given error margin, and optionally ignoring differences in global phase.
fn construct_matrix(&self, parameters: &Self::Parameters) -> Result<Matrix>
Constructs a matrix from the given parameter set.
Implementors
impl MatrixConverter for FixedMatrixConverter
[src]
type Parameters = ()
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, _: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for PhaseKMatrixConverter
[src]
type Parameters = u64
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, k: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for PhaseMatrixConverter
[src]
type Parameters = f64
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, theta: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for RMatrixConverter
[src]
type Parameters = (f64, f64, f64)
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, params: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for RxMatrixConverter
[src]
type Parameters = f64
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, theta: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for RyMatrixConverter
[src]
type Parameters = f64
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, theta: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for RzMatrixConverter
[src]
type Parameters = f64
fn detect_matrix(
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
epsilon: f64,
ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
fn construct_matrix(&self, theta: &Self::Parameters) -> Result<Matrix>
[src]
impl MatrixConverter for UMatrixConverter
[src]
type Parameters = Matrix
fn detect_matrix(
&self,
matrix: &Matrix,
_epsilon: f64,
_ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>
[src]
&self,
matrix: &Matrix,
_epsilon: f64,
_ignore_global_phase: bool
) -> Result<Option<Self::Parameters>>