pub fn call_operation(operation: &Operation) -> Result<Option<AqtInstruction>, RoqoqoBackendError> {
    match operation {
        Operation::RotateZ(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Z".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::RotateX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "X".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::RotateY(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Y".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliZ(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Z".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "X".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliY(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Y".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::VariableMSXX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "MS".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.control() as u32, *op.target() as u32],
        )))),
        Operation::MolmerSorensenXX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "MS".to_string(),
            0.5,
            vec![*op.control() as u32, *op.target() as u32],
        )))),
        _ => {
            if ALLOWED_OPERATIONS.contains(&operation.hqslang()) {
                Ok(None)
            } else {
                Err(RoqoqoBackendError::OperationNotInBackend {
                    backend: "AQT",
                    hqslang: operation.hqslang(),
                })
            }
        }
    }
}
/// Converts a [roqoqo::operations::Operation] into an instruction for AQT Hardware or AQT Simulators
///
/// # Arguments
///
/// `operation` - The [roqoqo::operations::Operation] that is converted
///
/// # Returns
///
/// `AqtInstruction` - Converted instruction
/// `RoqoqoBackendError::OperationNotInBackend` - Error when [roqoqo::operations::Operation] can not be converted
Converts a [roqoqo::operations::Operation] into an instruction for AQT Hardware or AQT Simulators
Converts a [ roqoqo :: operations :: Operation ] into an instruction for AQT Hardware or AQT Simulators
pub fn call_operation(operation: &Operation) -> Result<Option<AqtInstruction>, RoqoqoBackendError> {
    match operation {
        Operation::RotateZ(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Z".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::RotateX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "X".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::RotateY(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Y".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliZ(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Z".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "X".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::PauliY(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "Y".to_string(),
            1.0,
            vec![*op.qubit() as u32],
        )))),
        Operation::VariableMSXX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "MS".to_string(),
            *op.theta().float()? / std::f64::consts::PI,
            vec![*op.control() as u32, *op.target() as u32],
        )))),
        Operation::MolmerSorensenXX(op) => Ok(Some(AqtInstruction::SingleParameterInstruction((
            "MS".to_string(),
            0.5,
            vec![*op.control() as u32, *op.target() as u32],
        )))),
        _ => {
            if ALLOWED_OPERATIONS.contains(&operation.hqslang()) {
                Ok(None)
            } else {
                Err(RoqoqoBackendError::OperationNotInBackend {
                    backend: "AQT",
                    hqslang: operation.hqslang(),
                })
            }
        }
    }
}
pub fn call_operation ( operation : & Operation ) -> Result < Option < AqtInstruction > , RoqoqoBackendError > { match operation { Operation :: RotateZ ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , * op . theta ( ) . float ( ) ? / std :: f64 :: consts :: PI , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: RotateX ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , * op . theta ( ) . float ( ) ? / std :: f64 :: consts :: PI , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: RotateY ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , * op . theta ( ) . float ( ) ? / std :: f64 :: consts :: PI , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: PauliZ ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , 1.0 , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: PauliX ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , 1.0 , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: PauliY ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , 1.0 , vec ! [ op qubit ( ) as u32 ] , ) ) ) ) , Operation :: VariableMSXX ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , * op . theta ( ) . float ( ) ? / std :: f64 :: consts :: PI , vec ! [ op control ( ) as u32 op target ( ) as u32 ] , ) ) ) ) , Operation :: MolmerSorensenXX ( op ) => Ok ( Some ( AqtInstruction :: SingleParameterInstruction ( ( " " . to_string ( ) , 0.5 , vec ! [ op control ( ) as u32 op target ( ) as u32 ] , ) ) ) ) , _ => { if ALLOWED_OPERATIONS . contains ( & operation . hqslang ( ) ) { Ok ( None ) } else { Err ( RoqoqoBackendError :: OperationNotInBackend { backend : " " , hqslang : operation . hqslang ( ) , } ) } } } }
Converts a [roqoqo::operations::Operation] into an instruction for AQT Hardware or AQT Simulators
Converts a [ roqoqo :: operations :: Operation ] into an instruction for AQT Hardware or AQT Simulators
operation
&Operation
`AqtInstruction` - Converted instruction
`RoqoqoBackendError::OperationNotInBackend` - Error when [roqoqo::operations::Operation] can not be converted
` AqtInstruction ` - Converted instruction ` RoqoqoBackendError :: OperationNotInBackend ` - Error when [ roqoqo :: operations :: Operation ] can not be converted
operation
&Operation