diff --git a/source/compiler/qsc_partial_eval/src/evaluation_context.rs b/source/compiler/qsc_partial_eval/src/evaluation_context.rs index bcd6aeab3e..80f17ff22c 100644 --- a/source/compiler/qsc_partial_eval/src/evaluation_context.rs +++ b/source/compiler/qsc_partial_eval/src/evaluation_context.rs @@ -7,7 +7,7 @@ use qsc_eval::{ val::{Result, Value}, }; use qsc_fir::fir::{LocalItemId, LocalVarId, PackageId}; -use qsc_rca::{RuntimeKind, ValueKind}; +use qsc_rca::{ComputeKind, RuntimeFeatureFlags, ValueKind}; use qsc_rir::rir::{BlockId, Literal, VariableId}; use rustc_hash::FxHashMap; use std::collections::hash_map::Entry; @@ -99,8 +99,8 @@ pub struct Scope { pub package_id: PackageId, /// The ID and functor information of the callable. pub callable: Option<(LocalItemId, FunctorApp)>, - /// The value of the arguments passed to the callable. - pub args_value_kind: Vec, + /// The compute kind of the arguments passed to the callable. + pub args_compute_kind: Vec, /// The classical environment of the callable, which holds values corresponding to local variables. pub env: Env, /// Map that holds the values of local variables. @@ -127,15 +127,18 @@ impl Scope { let mut env = Env::default(); env.push_scope(CLASSICAL_EVALUATOR_CALL_SCOPE_ID); - // Determine the runtime kind (static or dynamic) of the arguments. - let args_value_kind: Vec = args + // Determine the compute kind of the arguments, assuming empty feature flags. + let args_compute_kind: Vec = args .iter() .map(|arg| { let value = match arg { Arg::Discard(value) => value, Arg::Var(_, var) => &var.value, }; - map_eval_value_to_value_kind(value) + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::empty(), + map_eval_value_to_value_kind(value), + ) }) .collect(); @@ -149,7 +152,7 @@ impl Scope { // Add the values to both the classical environment and the hybrid variables depending on whether the value is // static or dynamic. - let arg_runtime_kind_tuple = args.into_iter().zip(args_value_kind.iter()); + let arg_runtime_kind_tuple = args.into_iter().zip(args_compute_kind.iter()); for (arg, _) in arg_runtime_kind_tuple { let Arg::Var(local_var_id, var) = arg else { continue; @@ -162,7 +165,7 @@ impl Scope { Self { package_id, callable, - args_value_kind, + args_compute_kind, env, active_block_count: 1, hybrid_vars, @@ -286,39 +289,27 @@ impl EvalControlFlow { } fn map_eval_value_to_value_kind(value: &Value) -> ValueKind { - fn map_array_eval_value_to_value_kind(elements: &[Value]) -> ValueKind { - let mut content_runtime_kind = RuntimeKind::Static; - for element in elements { - let element_value_kind = map_eval_value_to_value_kind(element); - if element_value_kind.is_dynamic() { - content_runtime_kind = RuntimeKind::Dynamic; - break; + match value { + Value::Array(elements) => { + for element in elements.iter() { + let element_runtime_kind = map_eval_value_to_value_kind(element); + if element_runtime_kind == ValueKind::Dynamic { + return ValueKind::Dynamic; + } } - } - // The runtime capabilities check pass disallows dynamically-sized arrays for all targets for which we generate - // QIR. Because of this, we assume that during partial evaluation all arrays are statically-sized. - ValueKind::Array(content_runtime_kind, RuntimeKind::Static) - } - - fn map_tuple_eval_value_to_value_kind(elements: &[Value]) -> ValueKind { - let mut runtime_kind = RuntimeKind::Static; - for element in elements { - let element_value_kind = map_eval_value_to_value_kind(element); - if element_value_kind.is_dynamic() { - runtime_kind = RuntimeKind::Dynamic; - break; - } + ValueKind::Static } - ValueKind::Element(runtime_kind) - } - - match value { - Value::Array(elements) => map_array_eval_value_to_value_kind(elements), - Value::Tuple(elements, _) => map_tuple_eval_value_to_value_kind(elements), - Value::Result(Result::Id(_) | Result::Loss) | Value::Var(_) => { - ValueKind::Element(RuntimeKind::Dynamic) + Value::Tuple(elements, _) => { + for element in elements.iter() { + let element_runtime_kind = map_eval_value_to_value_kind(element); + if element_runtime_kind == ValueKind::Dynamic { + return ValueKind::Dynamic; + } + } + ValueKind::Static } + Value::Result(Result::Id(_) | Result::Loss) | Value::Var(_) => ValueKind::Dynamic, Value::BigInt(_) | Value::Bool(_) | Value::Closure(_) @@ -329,6 +320,6 @@ fn map_eval_value_to_value_kind(value: &Value) -> ValueKind { | Value::Qubit(_) | Value::Range(_) | Value::Result(Result::Val(_)) - | Value::String(_) => ValueKind::Element(RuntimeKind::Static), + | Value::String(_) => ValueKind::Static, } } diff --git a/source/compiler/qsc_partial_eval/src/lib.rs b/source/compiler/qsc_partial_eval/src/lib.rs index 58595ce8bb..27c1cea13f 100644 --- a/source/compiler/qsc_partial_eval/src/lib.rs +++ b/source/compiler/qsc_partial_eval/src/lib.rs @@ -40,7 +40,7 @@ use qsc_fir::{ use qsc_lowerer::map_fir_package_to_hir; use qsc_rca::{ ComputeKind, ComputePropertiesLookup, ItemComputeProperties, PackageStoreComputeProperties, - QuantumProperties, RuntimeFeatureFlags, RuntimeKind, ValueKind, + QuantumProperties, RuntimeFeatureFlags, ValueKind, errors::{ Error as CapabilityError, generate_errors_from_runtime_features, get_missing_runtime_features, @@ -1526,7 +1526,7 @@ impl<'a> PartialEvaluator<'a> { // If the call produces a dynamic value, we treat it as an error because we know that later // analysis has not taken that dynamism into account and further partial evaluation may fail // when it encounters that value. - if value_kind.is_dynamic() { + if value_kind == ValueKind::Dynamic { return Err(Error::UnexpectedDynamicValue( self.get_expr_package_span(call_expr_id), )); @@ -2211,14 +2211,7 @@ impl<'a> PartialEvaluator<'a> { // Verify assumptions: the condition expression must either classical (such that it can be fully evaluated) or // quantum but statically known at runtime (such that it can be partially evaluated to a known value). assert!( - matches!( - self.get_expr_compute_kind(condition_expr_id), - ComputeKind::Classical - | ComputeKind::Quantum(QuantumProperties { - runtime_features: _, - value_kind: ValueKind::Element(RuntimeKind::Static), - }) - ), + !self.get_expr_compute_kind(condition_expr_id).is_dynamic(), "loop conditions must be purely classical" ); @@ -2636,7 +2629,7 @@ impl<'a> PartialEvaluator<'a> { let store_expr_id = StoreExprId::from((current_package_id, expr_id)); let expr_generator_set = self.compute_properties.get_expr(store_expr_id); let callable_scope = self.eval_context.get_current_scope(); - expr_generator_set.generate_application_compute_kind(&callable_scope.args_value_kind) + expr_generator_set.generate_application_compute_kind(&callable_scope.args_compute_kind) } fn is_unresolved_callee_expr(&self, expr_id: ExprId) -> bool { @@ -2677,7 +2670,7 @@ impl<'a> PartialEvaluator<'a> { }, None => panic!("call compute kind should have callable"), }; - callable_generator_set.generate_application_compute_kind(&callable_scope.args_value_kind) + callable_generator_set.generate_application_compute_kind(&callable_scope.args_compute_kind) } fn try_create_mutable_variable( diff --git a/source/compiler/qsc_rca/src/applications.rs b/source/compiler/qsc_rca/src/applications.rs index 13ca9cc108..8d38c6052b 100644 --- a/source/compiler/qsc_rca/src/applications.rs +++ b/source/compiler/qsc_rca/src/applications.rs @@ -2,8 +2,7 @@ // Licensed under the MIT License. use crate::{ - ApplicationGeneratorSet, ComputeKind, QuantumProperties, RuntimeFeatureFlags, RuntimeKind, - ValueKind, + ApplicationGeneratorSet, ComputeKind, QuantumProperties, RuntimeFeatureFlags, ValueKind, common::{Local, LocalKind, LocalsLookup, initialize_locals_map}, scaffolding::InternalPackageComputeProperties, }; @@ -48,26 +47,19 @@ impl GeneratorSetsBuilder { for input_param in input_params { let input_param_variants = match input_param.ty { Ty::Array(_) => { - // For parameters of type array, three dynamic variants exit. Each - // - An array with static content and dynamic size. + // For parameters of type array, two dynamic variants exit. Each // - An array with dynamic content and static size. // - An array with dynamic content and dynamic size. - let static_content_dynamic_size = ApplicationInstance::new( - input_params, - controls, - return_type, - Some(( - input_param.index, - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Dynamic), - )), - ); let dynamic_content_static_size = ApplicationInstance::new( input_params, controls, return_type, Some(( input_param.index, - ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Static), + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::empty(), + ValueKind::Dynamic, + ), )), ); let dynamic_content_dynamic_size = ApplicationInstance::new( @@ -76,14 +68,13 @@ impl GeneratorSetsBuilder { return_type, Some(( input_param.index, - ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Dynamic), + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::UseOfDynamicallySizedArray, + ValueKind::Dynamic, + ), )), ); - vec![ - static_content_dynamic_size, - dynamic_content_static_size, - dynamic_content_dynamic_size, - ] + vec![dynamic_content_static_size, dynamic_content_dynamic_size] } _ => { // For non-array params, only one dynamic variant exists. @@ -91,7 +82,13 @@ impl GeneratorSetsBuilder { input_params, controls, return_type, - Some((input_param.index, ValueKind::Element(RuntimeKind::Dynamic))), + Some(( + input_param.index, + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::empty(), + ValueKind::Dynamic, + ), + )), )] } }; @@ -204,30 +201,21 @@ impl GeneratorSetsBuilder { panic!("expected an array param application"); }; array_compute_properties - .static_content_dynamic_size + .static_size .value_kind .iter() .for_each(|value_kind| { array_param_application - .static_content_dynamic_size + .static_size .aggregate_value_kind(*value_kind); }); array_compute_properties - .dynamic_content_static_size + .dynamic_size .value_kind .iter() .for_each(|value_kind| { array_param_application - .dynamic_content_static_size - .aggregate_value_kind(*value_kind); - }); - array_compute_properties - .dynamic_content_dynamic_size - .value_kind - .iter() - .for_each(|value_kind| { - array_param_application - .dynamic_content_dynamic_size + .dynamic_size .aggregate_value_kind(*value_kind); }); } @@ -258,7 +246,7 @@ impl GeneratorSetsBuilder { fn close_param(&mut self, param_index: InputParamIndex) -> ParamApplicationComputeProperties { const DYNAMIC_ELEMENTS_PARAM_VARIANTS: usize = 1; - const DYNAMIC_ARRAY_PARAM_VARIANTS: usize = 3; + const DYNAMIC_ARRAY_PARAM_VARIANTS: usize = 2; // We need to offset the index since the first top-level vector in application instances is reserved for the // inherent variant. @@ -276,24 +264,17 @@ impl GeneratorSetsBuilder { ParamApplicationComputeProperties::Element(compute_properties) } else if variants.len() == DYNAMIC_ARRAY_PARAM_VARIANTS { // IMPORTANT: the position of each application instance in the variants vector has a specific meaning, so - // we need the order of pops is consequential. - let dynamic_content_dynamic_size_application_instance = variants + // we need the order of pops to remain consistent. + let dynamic_size_application_instance = variants .pop() .expect("array parameter application instance could not be popped"); - let dynamic_content_static_size_application_instance = variants - .pop() - .expect("array parameter application instance could not be popped"); - let static_content_dynamic_size_application_instance = variants + let static_size_application_instance = variants .pop() .expect("array parameter application instance could not be popped"); ParamApplicationComputeProperties::Array(Box::new( ArrayParamApplicationComputeProperties { - static_content_dynamic_size: static_content_dynamic_size_application_instance - .close(), - dynamic_content_static_size: dynamic_content_static_size_application_instance - .close(), - dynamic_content_dynamic_size: dynamic_content_dynamic_size_application_instance - .close(), + static_size: static_size_application_instance.close(), + dynamic_size: dynamic_size_application_instance.close(), }, )) } else { @@ -464,7 +445,7 @@ impl ApplicationInstance { input_params: &Vec, controls: Option<&Local>, return_type: &Ty, - dynamic_param: Option<(InputParamIndex, ValueKind)>, + dynamic_param: Option<(InputParamIndex, ComputeKind)>, ) -> Self { // Initialize the locals map with the specialization controls (if any). let mut locals_map = LocalsComputeKindMap::default(); @@ -473,7 +454,7 @@ impl ApplicationInstance { // no runtime features here. let compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::empty(), - value_kind: ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static), + value_kind: ValueKind::Static, }); locals_map.insert( controls.var, @@ -492,13 +473,10 @@ impl ApplicationInstance { // If a dynamic application is provided, set the compute kind associated to the parameter accordingly. let mut compute_kind = ComputeKind::Classical; - if let Some((dynamic_param_index, dynamic_param_value_kind)) = dynamic_param + if let Some((dynamic_param_index, dynamic_param_compute_kind)) = dynamic_param && input_param_index == dynamic_param_index { - compute_kind = ComputeKind::Quantum(QuantumProperties { - runtime_features: RuntimeFeatureFlags::empty(), - value_kind: dynamic_param_value_kind, - }); + compute_kind = dynamic_param_compute_kind; } locals_map.insert( @@ -524,7 +502,7 @@ impl ApplicationInstance { fn close(self) -> ApplicationInstanceComputeProperties { // Determine the value kind of the application instance by going through each return expression aggregating // their value kind (if any). - let mut value_kinds = Vec::::new(); + let mut value_kinds = Vec::new(); for (return_expr_id, returned_value_expr_id) in self.return_expressions.clone() { let return_expr_compute_kind = self.get_expr_compute_kind(return_expr_id); @@ -557,11 +535,7 @@ impl ApplicationInstance { let value_kind = if value_kinds.is_empty() { None } else { - let initial_value_kind = if let Ty::Array(_) = self.return_type { - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static) - } else { - ValueKind::Element(RuntimeKind::Static) - }; + let initial_value_kind = ValueKind::Static; let value_kind = value_kinds.iter().fold( initial_value_kind, |aggregated_value_kind, return_value_kind| { @@ -695,16 +669,11 @@ impl ParamApplicationComputeProperties { crate::ParamApplication::Element(compute_kind) } Self::Array(array_param) => { - let static_content_dynamic_size = - array_param.static_content_dynamic_size.remove(item); - let dynamic_content_static_size = - array_param.dynamic_content_static_size.remove(item); - let dynamic_content_dynamic_size = - array_param.dynamic_content_dynamic_size.remove(item); + let dynamic_content_static_size = array_param.static_size.remove(item); + let dynamic_content_dynamic_size = array_param.dynamic_size.remove(item); crate::ParamApplication::Array(crate::ArrayParamApplication { - static_content_dynamic_size, - dynamic_content_static_size, - dynamic_content_dynamic_size, + static_size: dynamic_content_static_size, + dynamic_size: dynamic_content_dynamic_size, }) } } @@ -713,7 +682,6 @@ impl ParamApplicationComputeProperties { #[allow(clippy::struct_field_names)] struct ArrayParamApplicationComputeProperties { - static_content_dynamic_size: ApplicationInstanceComputeProperties, - dynamic_content_static_size: ApplicationInstanceComputeProperties, - dynamic_content_dynamic_size: ApplicationInstanceComputeProperties, + static_size: ApplicationInstanceComputeProperties, + dynamic_size: ApplicationInstanceComputeProperties, } diff --git a/source/compiler/qsc_rca/src/core.rs b/source/compiler/qsc_rca/src/core.rs index 5c3dd5f394..51bb62d1d6 100644 --- a/source/compiler/qsc_rca/src/core.rs +++ b/source/compiler/qsc_rca/src/core.rs @@ -3,7 +3,7 @@ use crate::{ ApplicationGeneratorSet, ArrayParamApplication, ComputeKind, ComputePropertiesLookup, - ParamApplication, QuantumProperties, RuntimeFeatureFlags, RuntimeKind, ValueKind, + ParamApplication, QuantumProperties, RuntimeFeatureFlags, ValueKind, applications::{ApplicationInstance, GeneratorSetsBuilder, LocalComputeKind}, common::{ AssignmentStmtCounter, Callee, FunctorAppExt, GlobalSpecId, Local, LocalKind, TyExt, @@ -62,7 +62,7 @@ impl<'a> Analyzer<'a> { fn analyze_expr_array(&mut self, exprs: &Vec) -> ComputeKind { // Visit each sub-expression in the array to determine their compute kind, and aggregate ONLY the runtime // features to the array's compute kind. - let default_value_kind = ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static); + let default_value_kind = ValueKind::Static; let mut compute_kind = ComputeKind::Classical; let mut has_dynamic_content = false; for expr_id in exprs { @@ -74,9 +74,6 @@ impl<'a> Analyzer<'a> { has_dynamic_content |= expr_compute_kind.is_dynamic(); } - // The value kind of an array expression has two components. The runtime value of its content and the runtime - // value of its size. For array expressions, the runtime value of its content depend on whether any of its - // elements is dynamic, and the runtime value of its size is always static. if has_dynamic_content { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!( @@ -84,8 +81,7 @@ impl<'a> Analyzer<'a> { ); }; - quantum_properties.value_kind = - ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Static); + quantum_properties.value_kind = ValueKind::Dynamic; } compute_kind @@ -100,12 +96,12 @@ impl<'a> Analyzer<'a> { self.visit_expr(value_expr_id); self.visit_expr(size_expr_id); - // The runtime features the array repeat expression is determined by aggregating the runtime features of both + // The runtime features of the array repeat expression are determined by aggregating the runtime features of both // the size and value expressions. let application_instance = self.get_current_application_instance(); let size_expr_compute_kind = *application_instance.get_expr_compute_kind(size_expr_id); let value_expr_compute_kind = *application_instance.get_expr_compute_kind(value_expr_id); - let default_value_kind = ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static); + let default_value_kind = ValueKind::Static; let mut compute_kind = ComputeKind::Classical; compute_kind = compute_kind.aggregate_runtime_features(size_expr_compute_kind, default_value_kind); @@ -119,22 +115,12 @@ impl<'a> Analyzer<'a> { RuntimeFeatureFlags::UseOfDynamicallySizedArray; } - // The value kind of an array expression has two components. The runtime kind of its content and the runtime - // kind of its size. For array repeat expressions, the runtime kind of its content depend on whether the - // value expression is dynamic, and the runtime kind of its size depend on whether the size expression is - // dynamic. - let content_runtime_value = if value_expr_compute_kind.is_dynamic() { - RuntimeKind::Dynamic - } else { - RuntimeKind::Static - }; - let size_runtime_value = if size_expr_compute_kind.is_dynamic() { - RuntimeKind::Dynamic - } else { - RuntimeKind::Static - }; quantum_properties.value_kind = - ValueKind::Array(content_runtime_value, size_runtime_value); + if value_expr_compute_kind.is_dynamic() || size_expr_compute_kind.is_dynamic() { + ValueKind::Dynamic + } else { + ValueKind::Static + }; } compute_kind @@ -155,7 +141,7 @@ impl<'a> Analyzer<'a> { // We do not care about the value kind for this kind of expression because it is an assignment, but we still // need a default one. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); + let default_value_kind = ValueKind::Static; let mut compute_kind = ComputeKind::Classical; // The compute kind of an assign expression is determined by the runtime features of the updated compute kind @@ -182,16 +168,15 @@ impl<'a> Analyzer<'a> { let mut replacement_value_compute_kind = *application_instance.get_expr_compute_kind(replacement_value_expr_id); - let mut default_value_kind = ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static); + let mut default_value_kind = ValueKind::Static; // If we are within a dynamic scope, the compute kind of the assign index expression is dynamic and an additional // runtime feature is used to mark the array itself as dynamically sized. if !application_instance.active_dynamic_scopes.is_empty() { - default_value_kind = ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Dynamic); - let replacement_ty = &self.get_expr(replacement_value_expr_id).ty; + default_value_kind = ValueKind::Dynamic; replacement_value_compute_kind = replacement_value_compute_kind.aggregate(ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicallySizedArray, - ValueKind::new_static_from_type(replacement_ty), + ValueKind::Static, )); } @@ -208,12 +193,7 @@ impl<'a> Analyzer<'a> { ); }; - let ValueKind::Array(content_runtime_value, _) = &mut quantum_properties.value_kind - else { - panic!("the value kind of the update must be an array variant"); - }; - - *content_runtime_value = RuntimeKind::Dynamic; + quantum_properties.value_kind = ValueKind::Dynamic; } // Update the compute kind of the local variable in the locals map. @@ -230,7 +210,7 @@ impl<'a> Analyzer<'a> { // replacement expressions. // We do not care about the value kind for this kind of expression because it is an assignment, but we still // need a default one. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); + let default_value_kind = ValueKind::Static; let index_compute_kind = *application_instance.get_expr_compute_kind(index_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = @@ -303,9 +283,9 @@ impl<'a> Analyzer<'a> { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicExponent, - ValueKind::Element(RuntimeKind::Static), + ValueKind::Static, ), - ValueKind::Element(RuntimeKind::Static), + ValueKind::Static, ); } @@ -354,7 +334,6 @@ impl<'a> Analyzer<'a> { }; // If this call happens within a dynamic scope, there might be additional runtime features being used. - let default_value_kind = ValueKind::new_static_from_type(expr_type); let application_instance = self.get_current_application_instance(); if !application_instance.active_dynamic_scopes.is_empty() { // If the call expression type is either a result or a qubit, it uses dynamic allocation runtime features. @@ -362,7 +341,7 @@ impl<'a> Analyzer<'a> { // We consider this qubit dynamic so the value kind of this expression must be dynamic. compute_kind = compute_kind.aggregate(ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::empty(), - value_kind: ValueKind::Element(RuntimeKind::Dynamic), + value_kind: ValueKind::Dynamic, })); } @@ -370,9 +349,9 @@ impl<'a> Analyzer<'a> { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::MeasurementWithinDynamicScope, - default_value_kind, + ValueKind::Static, ), - default_value_kind, + ValueKind::Static, ); } } @@ -390,9 +369,9 @@ impl<'a> Analyzer<'a> { let callee_expr_compute_kind = *application_instance.get_expr_compute_kind(callee_expr_id); let args_expr_compute_kind = *application_instance.get_expr_compute_kind(args_expr_id); compute_kind = - compute_kind.aggregate_runtime_features(callee_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(callee_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(args_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(args_expr_compute_kind, ValueKind::Static); compute_kind } @@ -408,7 +387,7 @@ impl<'a> Analyzer<'a> { { ComputeKind::new_with_runtime_features( quantum_properties.runtime_features, - ValueKind::Element(RuntimeKind::Dynamic), + ValueKind::Dynamic, ) } else { ComputeKind::Classical @@ -422,7 +401,6 @@ impl<'a> Analyzer<'a> { callee: &Callee, callable_decl: &'a CallableDecl, args_expr_id: ExprId, - expr_type: &Ty, fixed_args: Option>, ) -> CallComputeKind { // The `Length` intrinsic function has a specialized override. @@ -458,7 +436,7 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); // Derive the compute kind based on the value kind of the arguments. - let arg_value_kinds = if let Some(fixed_args) = fixed_args { + let arg_compute_kinds = if let Some(fixed_args) = fixed_args { // In items that come from lifted lambdas, fixed arguments that capture local variables, if any, come before // other arguments, so we use the `fixed_args` as the base of the chain of values and concatenate the rest of // the arguments when building the full list of arguments for a callable application. @@ -469,19 +447,18 @@ impl<'a> Analyzer<'a> { .locals_map .find_local_compute_kind(local_var_id) .map_or(ComputeKind::Classical, |v| v.compute_kind) - .value_kind_or_default(ValueKind::Element(RuntimeKind::Static)) }) - .chain(self.derive_arg_value_kinds(&arg_exprs)) + .chain(self.derive_arg_compute_kinds(&arg_exprs)) .collect() } else { - self.derive_arg_value_kinds(&arg_exprs) + self.derive_arg_compute_kinds(&arg_exprs) }; let mut compute_kind = - application_generator_set.generate_application_compute_kind(&arg_value_kinds); + application_generator_set.generate_application_compute_kind(&arg_compute_kinds); // Aggregate the runtime features of the qubit controls expressions. let mut has_dynamic_controls = false; - let default_value_kind = ValueKind::new_static_from_type(&callable_decl.output); + let default_value_kind = ValueKind::Static; for control_expr in args_controls { let control_expr_compute_kind = *application_instance.get_expr_compute_kind(control_expr); @@ -520,11 +497,11 @@ impl<'a> Analyzer<'a> { { // Create a default value kind for the call expression type just to know which variant we should map to. // Then map the currently computed variant onto it. - let mut mapped_value_kind = ValueKind::new_static_from_type(expr_type); + let mut mapped_runtime_kind = ValueKind::Static; quantum_properties .value_kind - .project_onto_variant(&mut mapped_value_kind); - quantum_properties.value_kind = mapped_value_kind; + .project_onto_variant(&mut mapped_runtime_kind); + quantum_properties.value_kind = mapped_runtime_kind; } CallComputeKind::Regular(compute_kind) } @@ -551,10 +528,9 @@ impl<'a> Analyzer<'a> { // The value kind of a call expression with an unresolved callee is not known, so to avoid // spurious errors in later analysis where the value is used we assume static. // During partial-evaluation, the callable is known the actual return kind will be checked. - let value_kind = ValueKind::new_static_from_type(expr_type); let compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToUnresolvedCallee, - value_kind, + value_kind: ValueKind::Static, }); self.get_current_application_instance_mut() .unresolved_callee_exprs @@ -580,7 +556,7 @@ impl<'a> Analyzer<'a> { .push(callee_expr_id); return CallComputeKind::Regular(ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToUnresolvedCallee, - value_kind: ValueKind::Element(RuntimeKind::Static), + value_kind: ValueKind::Static, })); } @@ -596,7 +572,6 @@ impl<'a> Analyzer<'a> { &callee, callable_decl, args_expr_id, - expr_type, fixed_args, ), Global::Udt => { @@ -611,15 +586,14 @@ impl<'a> Analyzer<'a> { // To determine the compute kind of an UDT call expression, aggregate the runtime features of the arguments // expression. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(args_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(args_expr_compute_kind, ValueKind::Static); // If any argument to the UDT constructor is dynamic, then the UDT instance is also dynamic and uses an // additional runtime feature. if args_expr_compute_kind.is_dynamic() { - compute_kind.aggregate_value_kind(ValueKind::Element(RuntimeKind::Dynamic)); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -634,9 +608,8 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let msg_expr_compute_kind = *application_instance.get_expr_compute_kind(msg_expr_id); let mut compute_kind = ComputeKind::Classical; - let default_value_kind = ValueKind::Element(RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(msg_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(msg_expr_compute_kind, ValueKind::Static); compute_kind } @@ -649,15 +622,15 @@ impl<'a> Analyzer<'a> { // the value kind adapted to the expression's type. let application_instance = self.get_current_application_instance(); let record_expr_compute_kind = *application_instance.get_expr_compute_kind(record_expr_id); - let value_kind = if record_expr_compute_kind.is_dynamic() { + let runtime_kind = if record_expr_compute_kind.is_dynamic() { ValueKind::new_dynamic_from_type(expr_type) } else { - ValueKind::new_static_from_type(expr_type) + ValueKind::Static }; let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(record_expr_compute_kind, value_kind); + compute_kind.aggregate_runtime_features(record_expr_compute_kind, runtime_kind); compute_kind } @@ -700,20 +673,19 @@ impl<'a> Analyzer<'a> { // Aggregate the runtime features of the sub-expressions. let application_instance = self.get_current_application_instance(); - let default_value_kind = ValueKind::new_static_from_type(expr_type); let mut compute_kind = ComputeKind::Classical; let condition_expr_compute_kind = *application_instance.get_expr_compute_kind(condition_expr_id); - compute_kind = compute_kind - .aggregate_runtime_features(condition_expr_compute_kind, default_value_kind); + compute_kind = + compute_kind.aggregate_runtime_features(condition_expr_compute_kind, ValueKind::Static); let body_expr_compute_kind = *application_instance.get_expr_compute_kind(body_expr_id); compute_kind = - compute_kind.aggregate_runtime_features(body_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(body_expr_compute_kind, ValueKind::Static); if let Some(otherwise_expr_id) = otherwise_expr_id { let otherwise_expr_compute_kind = *application_instance.get_expr_compute_kind(otherwise_expr_id); compute_kind = compute_kind - .aggregate_runtime_features(otherwise_expr_compute_kind, default_value_kind); + .aggregate_runtime_features(otherwise_expr_compute_kind, ValueKind::Static); } // If any of the sub-expressions is dynamic, then the compute kind of an if-expression is dynamic and additional @@ -724,16 +696,8 @@ impl<'a> Analyzer<'a> { .is_some_and(|e| application_instance.get_expr_compute_kind(e).is_dynamic()); if is_any_sub_expr_dynamic { let dynamic_value_kind = if matches!(expr_type, Ty::Array(..)) { - // An array coming from a dynamic conditional should be treated as dynamic in length - // and content. - ValueKind::Array( - RuntimeKind::Dynamic, - if condition_expr_compute_kind.is_dynamic() { - RuntimeKind::Dynamic - } else { - RuntimeKind::Static - }, - ) + // An array coming from a dynamic conditional should be treated as dynamic. + ValueKind::Dynamic } else { ValueKind::new_dynamic_from_type(expr_type) }; @@ -746,8 +710,14 @@ impl<'a> Analyzer<'a> { if is_any_result(expr_type) { dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicResult; } - if matches!(expr_type, Ty::Tuple(tup) if !tup.is_empty()) { - dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicTuple; + match expr_type { + Ty::Tuple(tup) if !tup.is_empty() => { + dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicTuple; + } + Ty::Array(_) => { + dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; + } + _ => {} } } let dynamic_compute_kind = ComputeKind::Quantum(QuantumProperties { @@ -775,43 +745,32 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let array_expr_compute_kind = *application_instance.get_expr_compute_kind(array_expr_id); let index_expr_compute_kind = *application_instance.get_expr_compute_kind(index_expr_id); - let default_value_kind = ValueKind::new_static_from_type(expr_type); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(array_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(array_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, ValueKind::Static); // If the index expression is dynamic, the value kind of the expression is also dynamic and an additional // runtime feature is used. - if let ComputeKind::Quantum(index_quantum_properties) = &index_expr_compute_kind { - let ValueKind::Element(index_runtime_value) = index_quantum_properties.value_kind - else { - panic!("the value kind of an index expression must be of the element variant"); - }; - - if matches!(index_runtime_value, RuntimeKind::Dynamic) { - let dynamic_runtime_features = RuntimeFeatureFlags::UseOfDynamicIndex; - let dynamic_value_kind = ValueKind::new_dynamic_from_type(expr_type); - compute_kind = compute_kind.aggregate(ComputeKind::Quantum(QuantumProperties { - runtime_features: dynamic_runtime_features, - value_kind: dynamic_value_kind, - })); - } + if let ComputeKind::Quantum(index_quantum_properties) = &index_expr_compute_kind + && index_quantum_properties.value_kind == ValueKind::Dynamic + { + let dynamic_runtime_features = RuntimeFeatureFlags::UseOfDynamicIndex; + let dynamic_runtime_kind = ValueKind::new_dynamic_from_type(expr_type); + compute_kind = compute_kind.aggregate(ComputeKind::Quantum(QuantumProperties { + runtime_features: dynamic_runtime_features, + value_kind: dynamic_runtime_kind, + })); } // The value kind of the access by index expression also depends on whether the content of the array expression // is dynamic. - if let ComputeKind::Quantum(array_quantum_properties) = &array_expr_compute_kind { - let ValueKind::Array(content_runtime_kind, _) = array_quantum_properties.value_kind - else { - panic!("the value kind of an array expression must be of the array variant"); - }; - - if matches!(content_runtime_kind, RuntimeKind::Dynamic) { - let dynamic_value_kind = ValueKind::new_dynamic_from_type(expr_type); - compute_kind.aggregate_value_kind(dynamic_value_kind); - } + if let ComputeKind::Quantum(array_quantum_properties) = &array_expr_compute_kind + && array_quantum_properties.value_kind == ValueKind::Dynamic + { + let dynamic_value_kind = ValueKind::new_dynamic_from_type(expr_type); + compute_kind.aggregate_value_kind(dynamic_value_kind); } // If the index expression is dynamic, aggregate the corresponding runtime features depending on its type. @@ -831,7 +790,6 @@ impl<'a> Analyzer<'a> { start_expr_id: Option, step_expr_id: Option, end_expr_id: Option, - expr_type: &Ty, ) -> ComputeKind { // Visit the start, step and end expressions to determine their compute kind. if let Some(e) = start_expr_id.as_ref() { @@ -862,10 +820,9 @@ impl<'a> Analyzer<'a> { // Additionally, if the compute kind of the range is dynamic, mark it with the appropriate runtime feature. if compute_kind.is_dynamic() { - let static_value_kind = ValueKind::new_static_from_type(expr_type); compute_kind = compute_kind.aggregate(ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicRange, - static_value_kind, + ValueKind::Static, )); } compute_kind @@ -882,15 +839,14 @@ impl<'a> Analyzer<'a> { } else { ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::ReturnWithinDynamicScope, - value_kind: ValueKind::Element(RuntimeKind::Static), + value_kind: ValueKind::Static, }) }; // Now just aggregate the runtime features of the value expression. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let value_expr_compute_kind = *application_instance.get_expr_compute_kind(value_expr_id); compute_kind = - compute_kind.aggregate_runtime_features(value_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(value_expr_compute_kind, ValueKind::Static); compute_kind } @@ -900,7 +856,6 @@ impl<'a> Analyzer<'a> { fields: &[FieldAssign], expr_type: &Ty, ) -> ComputeKind { - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; let mut has_dynamic_sub_exprs = false; if let Some(copy_expr_id) = copy { @@ -909,7 +864,7 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let expr_compute_kind = *application_instance.get_expr_compute_kind(copy_expr_id); compute_kind = - compute_kind.aggregate_runtime_features(expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(expr_compute_kind, ValueKind::Static); has_dynamic_sub_exprs |= expr_compute_kind.is_dynamic(); } @@ -919,13 +874,13 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let expr_compute_kind = *application_instance.get_expr_compute_kind(expr_id); compute_kind = - compute_kind.aggregate_runtime_features(expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(expr_compute_kind, ValueKind::Static); has_dynamic_sub_exprs |= expr_compute_kind.is_dynamic(); } // If any of the sub-expressions are dynamic, then the struct expression is dynamic as well. if has_dynamic_sub_exprs { - compute_kind.aggregate_value_kind(ValueKind::Element(RuntimeKind::Dynamic)); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } // If the constructor is dynamic, aggregate the corresponding runtime features depending on its type. @@ -943,7 +898,6 @@ impl<'a> Analyzer<'a> { fn analyze_expr_string(&mut self, components: &Vec) -> ComputeKind { // Visit the string components to determine their compute kind, aggregate its runtime features and track whether // any of them is dynamic to construct the compute kind of the string expression itself. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut has_dynamic_components = false; let mut compute_kind = ComputeKind::Classical; for component in components { @@ -954,7 +908,7 @@ impl<'a> Analyzer<'a> { let component_compute_kind = *application_instance.get_expr_compute_kind(*expr_id); compute_kind = compute_kind - .aggregate_runtime_features(component_compute_kind, default_value_kind); + .aggregate_runtime_features(component_compute_kind, ValueKind::Static); has_dynamic_components |= component_compute_kind.is_dynamic(); } StringComponent::Lit(_) => { @@ -969,7 +923,7 @@ impl<'a> Analyzer<'a> { panic!("Quantum variant was expected for the compute kind of string expression "); }; quantum_properties.runtime_features |= RuntimeFeatureFlags::UseOfDynamicString; - quantum_properties.value_kind = ValueKind::Element(RuntimeKind::Dynamic); + quantum_properties.value_kind = ValueKind::Dynamic; } compute_kind @@ -978,7 +932,6 @@ impl<'a> Analyzer<'a> { fn analyze_expr_tuple(&mut self, exprs: &Vec) -> ComputeKind { // Visit the sub-expressions to determine their compute kind, aggregate its runtime features and track whether // any of them is dynamic to construct the compute kind of the tuple expression itself. - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; let mut has_dynamic_sub_exprs = false; for expr_id in exprs { @@ -986,13 +939,13 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let expr_compute_kind = *application_instance.get_expr_compute_kind(*expr_id); compute_kind = - compute_kind.aggregate_runtime_features(expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(expr_compute_kind, ValueKind::Static); has_dynamic_sub_exprs |= expr_compute_kind.is_dynamic(); } // If any of the sub-expressions is dynamic, then the tuple expression is dynamic as well. if has_dynamic_sub_exprs { - compute_kind.aggregate_value_kind(ValueKind::Element(RuntimeKind::Dynamic)); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -1022,16 +975,15 @@ impl<'a> Analyzer<'a> { let record_expr_compute_kind = *application_instance.get_expr_compute_kind(record_expr_id); let replace_expr_compute_kind = *application_instance.get_expr_compute_kind(replace_expr_id); - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(record_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(record_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(replace_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(replace_expr_compute_kind, ValueKind::Static); // If either the record or the replace expressions are dynamic, the update field expression is dynamic as well. if record_expr_compute_kind.is_dynamic() || replace_expr_compute_kind.is_dynamic() { - compute_kind.aggregate_value_kind(ValueKind::Element(RuntimeKind::Dynamic)); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -1055,23 +1007,21 @@ impl<'a> Analyzer<'a> { let index_expr_compute_kind = *application_instance.get_expr_compute_kind(index_expr_id); let replacement_value_expr_compute_kind = *application_instance.get_expr_compute_kind(replacement_value_expr_id); - let default_value_kind = ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(array_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(array_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, ValueKind::Static); compute_kind = compute_kind - .aggregate_runtime_features(replacement_value_expr_compute_kind, default_value_kind); - + .aggregate_runtime_features(replacement_value_expr_compute_kind, ValueKind::Static); // If the index expression is dynamic, an additional runtime feature is used. if index_expr_compute_kind.is_dynamic() { let additional_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::UseOfDynamicIndex, - value_kind: default_value_kind, + value_kind: ValueKind::Static, }); - compute_kind = compute_kind - .aggregate_runtime_features(additional_compute_kind, default_value_kind); + compute_kind = + compute_kind.aggregate_runtime_features(additional_compute_kind, ValueKind::Static); } // The value kind of the update index expression is based on the value kind of the array expression. @@ -1083,8 +1033,7 @@ impl<'a> Analyzer<'a> { // expression is also dynamic. if index_expr_compute_kind.is_dynamic() || replacement_value_expr_compute_kind.is_dynamic() { - let content_value_kind = ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Static); - compute_kind.aggregate_value_kind(content_value_kind); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -1149,12 +1098,11 @@ impl<'a> Analyzer<'a> { // Return the aggregated runtime features of the condition expression and the block. let application_instance = self.get_current_application_instance(); let block_compute_kind = *application_instance.get_block_compute_kind(block_id); - let default_value_kind = ValueKind::Element(RuntimeKind::Static); let mut compute_kind = ComputeKind::Classical; - compute_kind = compute_kind - .aggregate_runtime_features(condition_expr_compute_kind, default_value_kind); compute_kind = - compute_kind.aggregate_runtime_features(block_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(condition_expr_compute_kind, ValueKind::Static); + compute_kind = + compute_kind.aggregate_runtime_features(block_compute_kind, ValueKind::Static); // If the condition is dynamic, we require an additional runtime feature. if condition_expr_compute_kind.is_dynamic() { @@ -1235,7 +1183,7 @@ impl<'a> Analyzer<'a> { } else { entry_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: ty_flags, - value_kind: ValueKind::new_static_from_type(&entry_ty), + value_kind: ValueKind::Static, }); } self.get_current_application_instance_mut() @@ -1371,8 +1319,7 @@ impl<'a> Analyzer<'a> { Mutability::Mutable => LocalKind::Mutable, }; let application_instance = self.get_current_application_instance(); - let expr_compute_kind = *application_instance.get_expr_compute_kind(expr_id); - let bound_compute_kind = ComputeKind::map_to_type(expr_compute_kind, &pat.ty); + let bound_compute_kind = *application_instance.get_expr_compute_kind(expr_id); self.bind_compute_kind_to_ident(ident, local_kind, bound_compute_kind); } PatKind::Tuple(pats) => match &expr.kind { @@ -1405,8 +1352,7 @@ impl<'a> Analyzer<'a> { Mutability::Mutable => LocalKind::Mutable, }; let application_instance = self.get_current_application_instance(); - let expr_compute_kind = *application_instance.get_expr_compute_kind(expr_id); - let bound_compute_kind = ComputeKind::map_to_type(expr_compute_kind, &pat.ty); + let bound_compute_kind = *application_instance.get_expr_compute_kind(expr_id); self.bind_compute_kind_to_ident(ident, local_kind, bound_compute_kind); } PatKind::Tuple(pats) => { @@ -1425,17 +1371,14 @@ impl<'a> Analyzer<'a> { .clear_current_spec_context() } - fn derive_arg_value_kinds(&self, args: &Vec) -> Vec { + fn derive_arg_compute_kinds(&self, args: &Vec) -> Vec { let application_instance = self.get_current_application_instance(); - let mut args_value_kinds = Vec::::with_capacity(args.len()); + let mut args_compute_kinds = Vec::::with_capacity(args.len()); for arg_expr_id in args { let arg_compute_kind = application_instance.get_expr_compute_kind(*arg_expr_id); - let arg_expr = self.get_expr(*arg_expr_id); - let default_value_kind = ValueKind::new_static_from_type(&arg_expr.ty); - let arg_value_kind = arg_compute_kind.value_kind_or_default(default_value_kind); - args_value_kinds.push(arg_value_kind); + args_compute_kinds.push(*arg_compute_kind); } - args_value_kinds + args_compute_kinds } fn get_current_application_instance(&self) -> &ApplicationInstance { @@ -1590,9 +1533,7 @@ impl<'a> Analyzer<'a> { // a UDT variable field since we do not track individual UDT fields). let value_expr_compute_kind = *application_instance.get_expr_compute_kind(value_expr_id); - let assigned_compute_kind = - ComputeKind::map_to_type(value_expr_compute_kind, &assignee_expr.ty); - updated_compute_kind = updated_compute_kind.aggregate(assigned_compute_kind); + updated_compute_kind = updated_compute_kind.aggregate(value_expr_compute_kind); // If a local is updated within a dynamic scope, the updated value of the local variable should be // dynamic and additional runtime features may apply. @@ -1642,7 +1583,6 @@ impl<'a> Analyzer<'a> { assert!(assignee_exprs.len() == value_exprs.len()); // To determine the update compute kind, we aggregate the runtime features of each element. - let default_value_kind = ValueKind::new_static_from_type(&value_expr.ty); let mut updated_compute_kind = ComputeKind::Classical; for (element_assignee_expr_id, element_value_expr_id) in assignee_exprs.iter().zip(value_exprs.iter()) @@ -1653,20 +1593,19 @@ impl<'a> Analyzer<'a> { ); updated_compute_kind = updated_compute_kind.aggregate_runtime_features( element_update_compute_kind, - default_value_kind, + ValueKind::Static, ); } updated_compute_kind } else { // To determine the update compute kind, we aggregate the runtime features of each update. - let default_value_kind = ValueKind::new_static_from_type(&value_expr.ty); let mut updated_compute_kind = ComputeKind::Classical; for element_assignee_expr_id in assignee_exprs { let element_update_compute_kind = self .update_locals_compute_kind(*element_assignee_expr_id, value_expr_id); updated_compute_kind = updated_compute_kind.aggregate_runtime_features( element_update_compute_kind, - default_value_kind, + ValueKind::Static, ); } updated_compute_kind @@ -1743,13 +1682,13 @@ fn update_features_for_type( // For arrays updated in a dynamic context, we also need to include the runtime feature // of dynamic arrays and change the value kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; - *dynamic_value_kind = ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Dynamic); + *dynamic_value_kind = ValueKind::Dynamic; } Ty::Tuple(tup) if !tup.is_empty() => { // For tuples updated in a dynamic context, we also need to include the runtime feature // of dynamic tuples and change the value kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicTuple; - *dynamic_value_kind = ValueKind::Element(RuntimeKind::Dynamic); + *dynamic_value_kind = ValueKind::Dynamic; } Ty::Prim(Prim::Result) => { // For result types updated in a dynamic context, we need to include the runtime @@ -1786,7 +1725,6 @@ impl<'a> Visitor<'a> for Analyzer<'a> { let block = self.get_block(block_id); // Visit each statement in the block and aggregate its compute kind. - let default_value_kind = ValueKind::new_static_from_type(&block.ty); let mut block_compute_kind = ComputeKind::Classical; for stmt_id in &block.stmts { // Visiting a statement performs its analysis for the current application instance. @@ -1795,8 +1733,8 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // Now, we can query the statement's compute kind and aggregate it to the block's compute kind. let application_instance = self.get_current_application_instance(); let stmt_compute_kind = *application_instance.get_stmt_compute_kind(*stmt_id); - block_compute_kind = block_compute_kind - .aggregate_runtime_features(stmt_compute_kind, default_value_kind); + block_compute_kind = + block_compute_kind.aggregate_runtime_features(stmt_compute_kind, ValueKind::Static); } // Update the block's value kind if its non-unit, based on the value kind of its last statement's expression. @@ -1811,7 +1749,7 @@ impl<'a> Visitor<'a> for Analyzer<'a> { let last_expr_compute_kind = application_instance.get_expr_compute_kind(last_expr_id); if let ComputeKind::Quantum(last_expr_quantum_properties) = last_expr_compute_kind { - let mut block_value_kind = ValueKind::new_static_from_type(&block.ty); + let mut block_value_kind = ValueKind::Static; last_expr_quantum_properties .value_kind .project_onto_variant(&mut block_value_kind); @@ -1931,7 +1869,6 @@ impl<'a> Visitor<'a> for Analyzer<'a> { start_expr_id.to_owned(), step_expr_id.to_owned(), end_expr_id.to_owned(), - &expr.ty, ), ExprKind::Return(value_expr_id) => { let compute_kind = self.analyze_expr_return(*value_expr_id); @@ -1969,7 +1906,7 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // tuple type), there could be a mismatch between the expected value kind variant for the expression's type // and the value kind that we got. // We fix this mismatch here. - let mut value_kind = ValueKind::new_static_from_type(&expr.ty); + let mut value_kind = ValueKind::Static; quantum_properties .value_kind .project_onto_variant(&mut value_kind); @@ -2055,10 +1992,8 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // runtime features since the value kind is meaningless for semicolon statements. let application_instance = self.get_current_application_instance(); let expr_compute_kind = *application_instance.get_expr_compute_kind(*expr_id); - ComputeKind::Classical.aggregate_runtime_features( - expr_compute_kind, - ValueKind::Element(RuntimeKind::Static), - ) + ComputeKind::Classical + .aggregate_runtime_features(expr_compute_kind, ValueKind::Static) } StmtKind::Local(mutability, pat_id, value_expr_id) => { // Visit the expression to determine its compute kind. @@ -2071,10 +2006,8 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // runtime features since the value kind is meaningless for local (binding) statements. let application_instance = self.get_current_application_instance(); let expr_compute_kind = *application_instance.get_expr_compute_kind(*value_expr_id); - ComputeKind::Classical.aggregate_runtime_features( - expr_compute_kind, - ValueKind::Element(RuntimeKind::Static), - ) + ComputeKind::Classical + .aggregate_runtime_features(expr_compute_kind, ValueKind::Static) } StmtKind::Item(_) => { // An item statement does not have any inherent quantum properties, so we just treat it as classical compute. @@ -2292,15 +2225,11 @@ fn array_param_application_from_runtime_features( value_kind: ValueKind, ) -> ParamApplication { ParamApplication::Array(ArrayParamApplication { - static_content_dynamic_size: ComputeKind::Quantum(QuantumProperties { - runtime_features: runtime_features | RuntimeFeatureFlags::UseOfDynamicallySizedArray, - value_kind, - }), - dynamic_content_static_size: ComputeKind::Quantum(QuantumProperties { + static_size: ComputeKind::Quantum(QuantumProperties { runtime_features, value_kind, }), - dynamic_content_dynamic_size: ComputeKind::Quantum(QuantumProperties { + dynamic_size: ComputeKind::Quantum(QuantumProperties { runtime_features: runtime_features | RuntimeFeatureFlags::UseOfDynamicallySizedArray, value_kind, }), @@ -2313,10 +2242,10 @@ fn derive_instrinsic_operation_application_generator_set( assert!(matches!(callable_context.kind, CallableKind::Operation)); // The value kind of intrinsic operations is inherently dynamic if their output is not `Unit` or `Qubit`. - let value_kind = if callable_context.output_type == Ty::UNIT + let runtime_kind = if callable_context.output_type == Ty::UNIT || callable_context.output_type == Ty::Prim(Prim::Qubit) { - ValueKind::Element(RuntimeKind::Static) + ValueKind::Static } else { ValueKind::new_dynamic_from_type(&callable_context.output_type) }; @@ -2332,7 +2261,7 @@ fn derive_instrinsic_operation_application_generator_set( // The compute kind of intrinsic operations is always quantum. let inherent_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: inherent_runtime_features, - value_kind, + value_kind: runtime_kind, }); // Determine the compute kind of all dynamic parameter applications. @@ -2419,19 +2348,9 @@ fn derive_runtime_features_for_value_kind_associated_to_type( value_kind: ValueKind, content_type: &Ty, ) -> RuntimeFeatureFlags { - let ValueKind::Array(content_runtime_kind, size_runtime_kind) = value_kind else { - panic!("expected array variant of value kind"); - }; - let mut runtime_features = RuntimeFeatureFlags::empty(); - // A dynamic array is dynamically sized. - if matches!(size_runtime_kind, RuntimeKind::Dynamic) { - runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; - } - - // A dynamic array has dynamic content so we need to include the runtime features used by its content. - if matches!(content_runtime_kind, RuntimeKind::Dynamic) { + if value_kind == ValueKind::Dynamic { let content_value_kind = ValueKind::new_dynamic_from_type(content_type); runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( content_value_kind, @@ -2446,11 +2365,7 @@ fn derive_runtime_features_for_value_kind_associated_to_type( value_kind: ValueKind, arrow: &Arrow, ) -> RuntimeFeatureFlags { - let ValueKind::Element(runtime_kind) = value_kind else { - panic!("expected element variant of value kind"); - }; - - if matches!(runtime_kind, RuntimeKind::Static) { + if value_kind == ValueKind::Static { return RuntimeFeatureFlags::empty(); } @@ -2464,12 +2379,8 @@ fn derive_runtime_features_for_value_kind_associated_to_type( value_kind: ValueKind, prim: Prim, ) -> RuntimeFeatureFlags { - match value_kind { - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static) - | ValueKind::Element(RuntimeKind::Static) => { - return RuntimeFeatureFlags::empty(); - } - _ => (), + if value_kind == ValueKind::Static { + return RuntimeFeatureFlags::empty(); } match prim { @@ -2492,11 +2403,7 @@ fn derive_runtime_features_for_value_kind_associated_to_type( value_kind: ValueKind, element_types: &Vec, ) -> RuntimeFeatureFlags { - let ValueKind::Element(runtime_kind) = value_kind else { - panic!("expected element variant of value kind"); - }; - - if matches!(runtime_kind, RuntimeKind::Static) { + if value_kind == ValueKind::Static { return RuntimeFeatureFlags::empty(); } @@ -2514,13 +2421,9 @@ fn derive_runtime_features_for_value_kind_associated_to_type( fn derive_runtime_features_for_value_kind_associated_to_udt( value_kind: ValueKind, ) -> RuntimeFeatureFlags { - let ValueKind::Element(runtime_kind) = value_kind else { - panic!("expected element variant of value kind"); - }; - - match runtime_kind { - RuntimeKind::Dynamic => RuntimeFeatureFlags::UseOfDynamicUdt, - RuntimeKind::Static => RuntimeFeatureFlags::empty(), + match value_kind { + ValueKind::Dynamic => RuntimeFeatureFlags::UseOfDynamicUdt, + ValueKind::Static => RuntimeFeatureFlags::empty(), } } diff --git a/source/compiler/qsc_rca/src/cyclic_callables.rs b/source/compiler/qsc_rca/src/cyclic_callables.rs index 3bf251fb1b..b081653616 100644 --- a/source/compiler/qsc_rca/src/cyclic_callables.rs +++ b/source/compiler/qsc_rca/src/cyclic_callables.rs @@ -155,9 +155,8 @@ impl<'a> Analyzer<'a> { // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => ParamApplication::Array(ArrayParamApplication { - static_content_dynamic_size: param_compute_kind, - dynamic_content_static_size: param_compute_kind, - dynamic_content_dynamic_size: param_compute_kind, + static_size: param_compute_kind, + dynamic_size: param_compute_kind, }), _ => ParamApplication::Element(param_compute_kind), }; @@ -290,9 +289,8 @@ fn create_operation_specialization_application_generator_set( // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => ParamApplication::Array(ArrayParamApplication { - static_content_dynamic_size: inherent_compute_kind, - dynamic_content_static_size: inherent_compute_kind, - dynamic_content_dynamic_size: inherent_compute_kind, + static_size: inherent_compute_kind, + dynamic_size: inherent_compute_kind, }), _ => ParamApplication::Element(inherent_compute_kind), }; diff --git a/source/compiler/qsc_rca/src/lib.rs b/source/compiler/qsc_rca/src/lib.rs index 167fd8e86a..69d4f15311 100644 --- a/source/compiler/qsc_rca/src/lib.rs +++ b/source/compiler/qsc_rca/src/lib.rs @@ -348,60 +348,43 @@ impl Display for ApplicationGeneratorSet { impl ApplicationGeneratorSet { #[must_use] - pub fn generate_application_compute_kind(&self, args_value_kinds: &[ValueKind]) -> ComputeKind { - assert!(self.dynamic_param_applications.len() == args_value_kinds.len()); + pub fn generate_application_compute_kind( + &self, + args_compute_kinds: &[ComputeKind], + ) -> ComputeKind { + assert!(self.dynamic_param_applications.len() == args_compute_kinds.len()); let mut compute_kind = self.inherent; - for (arg_value_kind, param_application) in args_value_kinds + for (arg_compute_kind, param_application) in args_compute_kinds .iter() .zip(self.dynamic_param_applications.iter()) { - // Since the generator set can have parameters with generic types as its basis, the value kind of the - // arguments used to derive a particular application might not match the variant of the generator set. - // Therefore, we need to fix the mismatch to know what particular compute kinds to aggregate. - let mapped_value_kind = match param_application { - ParamApplication::Array(_) => { - let mut mapped_value_kind = - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static); - arg_value_kind.project_onto_variant(&mut mapped_value_kind); - mapped_value_kind - } - ParamApplication::Element(_) => { - let mut mapped_value_kind = ValueKind::Element(RuntimeKind::Static); - arg_value_kind.project_onto_variant(&mut mapped_value_kind); - mapped_value_kind - } - }; - - // Now that we have fixed any possible mismatch between the value kind variants of the generator set - // parameters and the actual arguments used to derive the application, we can decide what to aggregate. - if let ValueKind::Element(RuntimeKind::Dynamic) = mapped_value_kind { - let ParamApplication::Element(param_compute_kind) = param_application else { - panic!("parameter application was expected to be an element variant"); - }; - - compute_kind = compute_kind.aggregate(*param_compute_kind); - } else if let ValueKind::Array(content_runtime_value, size_runtime_value) = - mapped_value_kind - { - let ParamApplication::Array(array_param_application) = param_application else { - panic!("parameter application was expected to be an array variant"); - }; - - let param_compute_kind = match (content_runtime_value, size_runtime_value) { - // When both the content and the size are static, we can treat it as aggregating a classical element. - (RuntimeKind::Static, RuntimeKind::Static) => ComputeKind::Classical, - (RuntimeKind::Dynamic, RuntimeKind::Static) => { - array_param_application.dynamic_content_static_size + match param_application { + ParamApplication::Element(param_compute_kind) => { + if arg_compute_kind.is_dynamic() { + compute_kind = compute_kind.aggregate(*param_compute_kind); } - (RuntimeKind::Static, RuntimeKind::Dynamic) => { - array_param_application.static_content_dynamic_size - } - (RuntimeKind::Dynamic, RuntimeKind::Dynamic) => { - array_param_application.dynamic_content_dynamic_size + } + ParamApplication::Array(array_param_application) => { + if let ComputeKind::Quantum(quantum_properties) = arg_compute_kind { + match quantum_properties.value_kind { + ValueKind::Dynamic + if quantum_properties + .runtime_features + .contains(RuntimeFeatureFlags::UseOfDynamicallySizedArray) => + { + compute_kind = + compute_kind.aggregate(array_param_application.dynamic_size); + } + ValueKind::Dynamic => { + compute_kind = + compute_kind.aggregate(array_param_application.static_size); + } + ValueKind::Static => { + // No aggregation needed for static arrays. + } + } } - }; - - compute_kind = compute_kind.aggregate(param_compute_kind); + } } } compute_kind @@ -428,9 +411,8 @@ impl Display for ParamApplication { #[derive(Clone, Debug)] pub struct ArrayParamApplication { - pub static_content_dynamic_size: ComputeKind, - pub dynamic_content_static_size: ComputeKind, - pub dynamic_content_dynamic_size: ComputeKind, + pub static_size: ComputeKind, + pub dynamic_size: ComputeKind, } impl Display for ArrayParamApplication { @@ -438,21 +420,8 @@ impl Display for ArrayParamApplication { let mut indent = set_indentation(indented(f), 0); write!(indent, "ArrayParamApplication:",)?; indent = set_indentation(indent, 1); - write!( - indent, - "\nstatic_content_dynamic_size: {}", - self.static_content_dynamic_size - )?; - write!( - indent, - "\ndynamic_content_static_size: {}", - self.dynamic_content_static_size - )?; - write!( - indent, - "\ndynamic_content_dynamic_size: {}", - self.dynamic_content_dynamic_size - )?; + write!(indent, "\nstatic_size: {}", self.static_size)?; + write!(indent, "\ndynamic_size: {}", self.dynamic_size)?; Ok(()) } } @@ -474,24 +443,8 @@ impl Display for ComputeKind { } impl ComputeKind { - pub(crate) fn map_to_type(compute_kind: Self, ty: &Ty) -> Self { - match compute_kind { - ComputeKind::Classical => ComputeKind::Classical, - ComputeKind::Quantum(quantum_properties) => { - let runtime_features = quantum_properties.runtime_features; - let mut value_kind = ValueKind::new_static_from_type(ty); - quantum_properties - .value_kind - .project_onto_variant(&mut value_kind); - ComputeKind::Quantum(QuantumProperties { - runtime_features, - value_kind, - }) - } - } - } - - pub(crate) fn new_with_runtime_features( + #[must_use] + pub fn new_with_runtime_features( runtime_features: RuntimeFeatureFlags, value_kind: ValueKind, ) -> Self { @@ -570,10 +523,13 @@ impl ComputeKind { quantum_properties.value_kind = quantum_properties.value_kind.aggregate(value); } - pub(crate) fn is_dynamic(self) -> bool { + #[must_use] + pub fn is_dynamic(self) -> bool { match self { Self::Classical => false, - Self::Quantum(quantum_properties) => quantum_properties.value_kind.is_dynamic(), + Self::Quantum(quantum_properties) => { + quantum_properties.value_kind == ValueKind::Dynamic + } } } @@ -583,13 +539,6 @@ impl ComputeKind { Self::Quantum(quantum_properties) => Some(quantum_properties.value_kind), } } - - pub(crate) fn value_kind_or_default(self, default: ValueKind) -> ValueKind { - match self { - Self::Classical => default, - Self::Quantum(quantum_properties) => quantum_properties.value_kind, - } - } } /// The quantum properties of a program element. @@ -597,7 +546,7 @@ impl ComputeKind { pub struct QuantumProperties { /// The runtime features used by the program element. pub runtime_features: RuntimeFeatureFlags, - /// The kind of value of the program element. + /// The kind of value produced by the program element. pub value_kind: ValueKind, } @@ -612,140 +561,52 @@ impl Display for QuantumProperties { } } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum ValueKind { - /// The first runtime kind corresponds to the content of the array while the second corresponds to the size. - Array(RuntimeKind, RuntimeKind), - /// Runtime kind corresponding to a single element. - Element(RuntimeKind), + Static, + Dynamic, } impl Display for ValueKind { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match &self { - Self::Array(content_runtime_value, size_runtime_value) => write!( - f, - "Array(Content: {content_runtime_value}, Size: {size_runtime_value})" - )?, - Self::Element(runtime_value) => write!(f, "Element({runtime_value})")?, + ValueKind::Static => { + write!(f, "Static")?; + } + ValueKind::Dynamic => { + write!(f, "Dynamic")?; + } } Ok(()) } } impl ValueKind { - pub(crate) fn new_dynamic_from_type(ty: &Ty) -> Self { - if *ty == Ty::UNIT { - // The associated value kind for a unit type is always static. - Self::Element(RuntimeKind::Static) - } else { - match ty { - // For a dynamic array, the content is dynamic and the size is static. - // We assume this because the source of the array produces something with dynamic length, - // that source should have already added the runtime feature flag for dynamic arrays. - Ty::Array(_) => ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Static), - // For every other dynamic type, we use the element variant with a dynamic runtime value. - _ => ValueKind::Element(RuntimeKind::Dynamic), - } - } - } - - pub(crate) fn new_static_from_type(ty: &Ty) -> Self { - match ty { - // For a static array, both contents and size are static. - Ty::Array(_) => ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static), - // For every other static type, we use the element variant with a static runtime value. - _ => ValueKind::Element(RuntimeKind::Static), - } - } - pub(crate) fn aggregate(self, value: ValueKind) -> Self { - match self { - Self::Array(self_content_runtime_value, self_size_runtime_value) => { - let Self::Array(other_content_runtime_value, other_size_runtime_value) = value - else { - panic!("only value kinds of the same variant can be aggregated"); - }; - - Self::Array( - self_content_runtime_value.aggregate(other_content_runtime_value), - self_size_runtime_value.aggregate(other_size_runtime_value), - ) - } - Self::Element(self_runtime_value) => { - let Self::Element(other_runtime_value) = value else { - panic!("only value kinds of the same variant can be aggregated"); - }; - Self::Element(self_runtime_value.aggregate(other_runtime_value)) - } + match value { + Self::Static => self, + Self::Dynamic => Self::Dynamic, } } - #[must_use] - pub fn is_dynamic(self) -> bool { - match self { - Self::Array(content_runtime_kind, size_runtime_kind) => { - matches!(content_runtime_kind, RuntimeKind::Dynamic) - || matches!(size_runtime_kind, RuntimeKind::Dynamic) - } - Self::Element(runtime_kind) => matches!(runtime_kind, RuntimeKind::Dynamic), + pub(crate) fn new_dynamic_from_type(ty: &Ty) -> Self { + if *ty == Ty::UNIT { + // The associated value kind for a unit type is always static. + Self::Static + } else { + Self::Dynamic } } pub(crate) fn project_onto_variant(self, variant: &mut ValueKind) { - match variant { - ValueKind::Array(content_runtime_kind, size_runtime_kind) => match self { - // We should resolve to an array value kind variant. - ValueKind::Array(self_content_runtime_kind, self_size_runtime_kind) => { - *content_runtime_kind = self_content_runtime_kind; - *size_runtime_kind = self_size_runtime_kind; - } - ValueKind::Element(self_runtime_kind) => { - *content_runtime_kind = self_runtime_kind; - // When we project from an element variant to an array variant, we assume the size of the - // array is statically sized because we rely on the dynamically sized arrays runtime feature - // flag to detect such cases. - *size_runtime_kind = RuntimeKind::Static; - } - }, - ValueKind::Element(runtime_kind) => { - // We should resolve to an element value kind variant. - *runtime_kind = if self.is_dynamic() { - RuntimeKind::Dynamic - } else { - RuntimeKind::Static - }; - } - } - } -} - -#[derive(Clone, Copy, Debug)] -pub enum RuntimeKind { - Static, - Dynamic, -} - -impl Display for RuntimeKind { - fn fmt(&self, f: &mut Formatter) -> fmt::Result { - match &self { - RuntimeKind::Static => { - write!(f, "Static")?; + match self { + ValueKind::Static => { + // No changes needed. } - RuntimeKind::Dynamic => { - write!(f, "Dynamic")?; + ValueKind::Dynamic => { + *variant = ValueKind::Dynamic; } } - Ok(()) - } -} - -impl RuntimeKind { - pub(crate) fn aggregate(self, value: RuntimeKind) -> Self { - match value { - Self::Static => self, - Self::Dynamic => Self::Dynamic, - } } } diff --git a/source/compiler/qsc_rca/src/overrider.rs b/source/compiler/qsc_rca/src/overrider.rs index 8ee895451a..7816b14a01 100644 --- a/source/compiler/qsc_rca/src/overrider.rs +++ b/source/compiler/qsc_rca/src/overrider.rs @@ -3,15 +3,15 @@ use crate::{ ApplicationGeneratorSet, ArrayParamApplication, ComputeKind, PackageId, ParamApplication, - QuantumProperties, RuntimeFeatureFlags, RuntimeKind, ValueKind, common::LocalSpecId, + QuantumProperties, RuntimeFeatureFlags, ValueKind, common::LocalSpecId, scaffolding::InternalPackageStoreComputeProperties, }; use qsc_fir::{ fir::{ Block, BlockId, CallableImpl, Expr, ExprId, Global, Item, ItemKind, LocalItemId, Package, - PackageStore, PackageStoreLookup, Pat, PatId, Stmt, StmtId, StmtKind, + PackageStore, PackageStoreLookup, Pat, PatId, Stmt, StmtId, }, - ty::{FunctorSetValue, Ty}, + ty::FunctorSetValue, visit::{Visitor, walk_block, walk_expr, walk_stmt}, }; use rustc_hash::FxHashMap; @@ -31,7 +31,6 @@ pub struct Overrider<'a> { } impl<'a> Overrider<'a> { - #[allow(clippy::too_many_lines)] pub fn new( package_store: &'a PackageStore, package_store_compute_properties: InternalPackageStoreComputeProperties, @@ -44,14 +43,10 @@ impl<'a> Overrider<'a> { inherent: ComputeKind::Classical, dynamic_param_applications: vec![ParamApplication::Array( ArrayParamApplication { - static_content_dynamic_size: ComputeKind::Quantum(QuantumProperties { + static_size: ComputeKind::Classical, + dynamic_size: ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::UseOfDynamicallySizedArray, - value_kind: ValueKind::Element(RuntimeKind::Dynamic), - }), - dynamic_content_static_size: ComputeKind::Classical, - dynamic_content_dynamic_size: ComputeKind::Quantum(QuantumProperties { - runtime_features: RuntimeFeatureFlags::UseOfDynamicallySizedArray, - value_kind: ValueKind::Element(RuntimeKind::Dynamic), + value_kind: ValueKind::Dynamic, }), }, )], @@ -176,25 +171,17 @@ impl<'a> Visitor<'a> for Overrider<'a> { fn visit_block(&mut self, id: BlockId) { walk_block(self, id); let package_id = self.get_current_package(); - let block = self.get_block(id); - let application_generator_set = adapt_application_generator_set_to_type( - self.get_current_application_generator_set(), - &block.ty, - ); + let application_generator_set = self.get_current_application_generator_set(); self.package_store_compute_properties - .insert_block((package_id, id).into(), application_generator_set); + .insert_block((package_id, id).into(), application_generator_set.clone()); } fn visit_expr(&mut self, id: ExprId) { walk_expr(self, id); let package_id = self.get_current_package(); - let expr = self.get_expr(id); - let application_generator_set = adapt_application_generator_set_to_type( - self.get_current_application_generator_set(), - &expr.ty, - ); + let application_generator_set = self.get_current_application_generator_set(); self.package_store_compute_properties - .insert_expr((package_id, id).into(), application_generator_set); + .insert_expr((package_id, id).into(), application_generator_set.clone()); } fn visit_package(&mut self, package: &'a Package, _: &PackageStore) { @@ -240,76 +227,8 @@ impl<'a> Visitor<'a> for Overrider<'a> { fn visit_stmt(&mut self, id: StmtId) { walk_stmt(self, id); let package_id = self.get_current_package(); - let stmt = self.get_stmt(id); - let stmt_type = match stmt.kind { - StmtKind::Expr(expr_id) => self.get_expr(expr_id).ty.clone(), - StmtKind::Item(_) | StmtKind::Local(_, _, _) | StmtKind::Semi(_) => Ty::UNIT, - }; - let application_generator_set = adapt_application_generator_set_to_type( - self.get_current_application_generator_set(), - &stmt_type, - ); + let application_generator_set = self.get_current_application_generator_set(); self.package_store_compute_properties - .insert_stmt((package_id, id).into(), application_generator_set); - } -} - -fn adapt_application_generator_set_to_type( - application_generator_set: &ApplicationGeneratorSet, - ty: &Ty, -) -> ApplicationGeneratorSet { - let inherent = adapt_compute_kind_to_type(application_generator_set.inherent, ty); - let mut dynamic_param_applications = Vec::new(); - for param_application in &application_generator_set.dynamic_param_applications { - let param_application = adapt_param_application_to_type(param_application, ty); - dynamic_param_applications.push(param_application); - } - ApplicationGeneratorSet { - inherent, - dynamic_param_applications, - } -} - -fn adapt_compute_kind_to_type(compute_kind: ComputeKind, ty: &Ty) -> ComputeKind { - match compute_kind { - ComputeKind::Classical => ComputeKind::Classical, - ComputeKind::Quantum(quantum_properties) => { - let runtime_features = quantum_properties.runtime_features; - let mut value_kind = ValueKind::new_static_from_type(ty); - quantum_properties - .value_kind - .project_onto_variant(&mut value_kind); - ComputeKind::Quantum(QuantumProperties { - runtime_features, - value_kind, - }) - } - } -} - -fn adapt_param_application_to_type( - param_application: &ParamApplication, - ty: &Ty, -) -> ParamApplication { - match param_application { - ParamApplication::Array(array_param_application) => { - let static_content_dynamic_size = - adapt_compute_kind_to_type(array_param_application.static_content_dynamic_size, ty); - let dynamic_content_static_size = - adapt_compute_kind_to_type(array_param_application.dynamic_content_static_size, ty); - let dynamic_content_dynamic_size = adapt_compute_kind_to_type( - array_param_application.dynamic_content_dynamic_size, - ty, - ); - ParamApplication::Array(ArrayParamApplication { - static_content_dynamic_size, - dynamic_content_static_size, - dynamic_content_dynamic_size, - }) - } - ParamApplication::Element(compute_kind) => { - let compute_kind = adapt_compute_kind_to_type(*compute_kind, ty); - ParamApplication::Element(compute_kind) - } + .insert_stmt((package_id, id).into(), application_generator_set.clone()); } } diff --git a/source/compiler/qsc_rca/src/tests/arrays.rs b/source/compiler/qsc_rca/src/tests/arrays.rs index cc68b674ab..b3973819cf 100644 --- a/source/compiler/qsc_rca/src/tests/arrays.rs +++ b/source/compiler/qsc_rca/src/tests/arrays.rs @@ -11,12 +11,10 @@ fn check_rca_for_array_with_classical_elements() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -32,14 +30,12 @@ fn check_rca_for_array_with_dynamic_results() { // Even though results are dynamic, they do not require any special runtime features to exist. check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -55,14 +51,12 @@ fn check_rca_for_array_with_dynamic_bools() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -73,12 +67,10 @@ fn check_rca_for_array_repeat_with_classical_value_and_classical_size() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -93,14 +85,12 @@ fn check_rca_for_array_repeat_with_dynamic_result_value_and_classical_size() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -116,14 +106,12 @@ fn check_rca_for_array_repeat_with_dynamic_bool_value_and_classical_size() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -139,14 +127,12 @@ fn check_rca_for_array_repeat_with_classical_value_and_dynamic_size() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Static, Size: Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -165,14 +151,12 @@ fn check_rca_for_array_repeat_with_dynamic_double_value_and_dynamic_size() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -195,7 +179,7 @@ fn check_rca_for_mutable_array_statically_appended() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -219,7 +203,7 @@ fn check_rca_for_mutable_array_dynamically_appended() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -265,7 +249,7 @@ fn check_rca_for_mutable_array_assignment_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -286,7 +270,7 @@ fn check_rca_for_immutable_array_bound_to_dynamic_array() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -332,7 +316,7 @@ fn check_rca_for_mutable_array_assign_index_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -357,7 +341,7 @@ fn check_rca_for_mutable_array_assign_index_dynamic_content_in_dynamic_context() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -382,7 +366,7 @@ fn check_rca_for_mutable_array_assign_index_dynamic_nested_array_content_in_dyna ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -400,9 +384,9 @@ fn check_rca_for_access_using_classical_index() { check_last_statement_compute_properties( package_store_compute_properties, &expect![[r#" - ApplicationsGeneratorSet: - inherent: Classical - dynamic_param_applications: "#]], + ApplicationsGeneratorSet: + inherent: Classical + dynamic_param_applications: "#]], ); } @@ -420,11 +404,11 @@ fn check_rca_for_access_using_dynamic_index() { check_last_statement_compute_properties( package_store_compute_properties, &expect![[r#" - ApplicationsGeneratorSet: - inherent: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble | UseOfDynamicIndex) - value_kind: Element(Dynamic) - dynamic_param_applications: "#]], + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble | UseOfDynamicIndex) + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -443,11 +427,11 @@ fn check_rca_for_array_with_dynamic_size_bound_through_tuple() { check_last_statement_compute_properties( package_store_compute_properties, &expect![[r#" - ApplicationsGeneratorSet: - inherent: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "#]], + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -469,11 +453,11 @@ fn check_rca_for_array_with_dynamic_size_bound_through_tuple_from_callable() { check_last_statement_compute_properties( package_store_compute_properties, &expect![[r#" - ApplicationsGeneratorSet: - inherent: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "#]], + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -538,7 +522,7 @@ fn check_rca_for_array_with_static_size_bound_through_dynamic_tuple() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -577,7 +561,50 @@ fn check_rca_for_index_range_on_array_with_dynamic_contents() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static + dynamic_param_applications: "#]], + ); +} + +#[test] +fn check_rca_for_indirect_length_on_array_with_dynamic_contents() { + let mut compilation_context = CompilationContext::default(); + compilation_context.update( + r#" + use qs = Qubit[5]; + let arr = MResetEachZ(qs); + (a -> Length(a))(arr)"#, + ); + let package_store_compute_properties = compilation_context.get_compute_properties(); + check_last_statement_compute_properties( + package_store_compute_properties, + &expect![[r#" + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(0x0) + value_kind: Static + dynamic_param_applications: "#]], + ); +} + +#[test] +fn check_rca_for_indirect_length_on_array_with_dynamic_length() { + let mut compilation_context = CompilationContext::default(); + compilation_context.update( + r#" + use q = Qubit(); + let arr = if M(q) == Zero { [true, true] } else { [true, true, true] }; + let size = (a -> Length(a))(arr); + size"#, + ); + let package_store_compute_properties = compilation_context.get_compute_properties(); + check_last_statement_compute_properties( + package_store_compute_properties, + &expect![[r#" + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) + value_kind: Dynamic dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/assigns.rs b/source/compiler/qsc_rca/src/tests/assigns.rs index ae5521584e..50a0f0922c 100644 --- a/source/compiler/qsc_rca/src/tests/assigns.rs +++ b/source/compiler/qsc_rca/src/tests/assigns.rs @@ -16,12 +16,10 @@ fn check_rca_for_classical_int_assign_to_local() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -38,14 +36,12 @@ fn check_rca_for_dynamic_result_assign_to_local() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -63,14 +59,12 @@ fn check_rca_for_dynamic_bool_assign_to_local() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -90,14 +84,12 @@ fn check_rca_for_dynamic_int_assign_to_local() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -118,14 +110,12 @@ fn check_rca_for_dynamic_double_assign_to_local() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -254,7 +244,7 @@ fn check_rca_for_assign_dynamic_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); compilation_context.update( @@ -268,7 +258,7 @@ fn check_rca_for_assign_dynamic_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -293,7 +283,7 @@ fn check_rca_for_assign_dynamic_static_mix_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic dynamic_param_applications: "#]], ); compilation_context.update( @@ -307,7 +297,7 @@ fn check_rca_for_assign_dynamic_static_mix_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -355,7 +345,7 @@ fn check_rca_for_mutable_classical_integer_assigned_updated_with_dynamic_integer ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -380,7 +370,7 @@ fn check_rca_for_mutable_dynamic_integer_assigned_updated_with_classical_integer ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -405,7 +395,7 @@ fn check_rca_for_mutable_dynamic_integer_assigned_updated_with_dynamic_integer() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -431,7 +421,7 @@ fn check_rca_for_mutable_dynamic_result_assigned_updated_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicResult) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -453,7 +443,7 @@ fn check_rca_for_immutable_dynamic_result_bound_to_dynamic_result() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicResult) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -480,7 +470,7 @@ fn check_rca_for_immutable_dynamic_result_bound_to_result_from_classical_conditi ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -509,7 +499,7 @@ fn check_rca_for_immutable_dynamic_result_bound_to_call_with_dynamic_args() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicResult) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -557,7 +547,7 @@ fn check_rca_for_mutable_tuple_assigned_updated_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicTuple) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -579,7 +569,7 @@ fn check_rca_for_immutable_tuple_bound_to_dynamic_tuple() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicTuple) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/bindings.rs b/source/compiler/qsc_rca/src/tests/bindings.rs index 85e393b746..bd0b94d0b9 100644 --- a/source/compiler/qsc_rca/src/tests/bindings.rs +++ b/source/compiler/qsc_rca/src/tests/bindings.rs @@ -17,12 +17,10 @@ fn check_rca_for_immutable_classical_result_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -38,14 +36,12 @@ fn check_rca_for_immutable_dynamic_result_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -60,12 +56,10 @@ fn check_rca_for_mutable_classical_bool_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -82,14 +76,12 @@ fn check_rca_for_mutable_dynamic_bool_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -104,12 +96,10 @@ fn check_rca_for_immutable_classical_int_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -128,14 +118,12 @@ fn check_rca_for_immutable_dynamic_int_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -150,12 +138,10 @@ fn check_rca_for_mutable_classical_double_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -175,13 +161,11 @@ fn check_rca_for_mutable_dynamic_double_binding() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/binops.rs b/source/compiler/qsc_rca/src/tests/binops.rs index 15e9876d3f..c357645604 100644 --- a/source/compiler/qsc_rca/src/tests/binops.rs +++ b/source/compiler/qsc_rca/src/tests/binops.rs @@ -11,12 +11,10 @@ fn check_rca_for_bin_op_with_classical_lhs_and_classical_rhs() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -31,14 +29,12 @@ fn check_rca_for_bin_op_with_dynamic_lhs_and_classical_rhs() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -53,14 +49,12 @@ fn check_rca_for_bin_op_with_classical_lhs_and_dynamic_rhs() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -76,14 +70,12 @@ fn check_rca_for_bin_op_with_dynamic_lhs_and_dynamic_rhs() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -98,12 +90,10 @@ fn check_rca_for_nested_bin_ops_with_classic_operands() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -119,14 +109,12 @@ fn check_rca_for_nested_bin_ops_with_a_dynamic_operand() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -137,12 +125,10 @@ fn check_rca_for_exp_op_with_classical_lhs_and_classical_rhs() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -163,7 +149,7 @@ fn check_rca_for_exp_op_with_dynamic_lhs_and_classical_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -185,7 +171,7 @@ fn check_rca_for_exp_op_with_classical_lhs_and_dynamic_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicExponent) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -209,7 +195,7 @@ fn check_rca_for_exp_op_with_dynamic_lhs_and_dynamic_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicExponent) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/callables.rs b/source/compiler/qsc_rca/src/tests/callables.rs index 74ddeba3c7..3f246c0931 100644 --- a/source/compiler/qsc_rca/src/tests/callables.rs +++ b/source/compiler/qsc_rca/src/tests/callables.rs @@ -14,22 +14,20 @@ fn check_rca_for_function_in_core_package() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Repeated", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | UseOfDynamicallySizedArray | LoopWithDynamicCondition) - value_kind: Array(Content: Dynamic, Size: Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -135,18 +133,16 @@ fn check_rca_for_operation_with_one_classical_return_and_one_dynamic_return() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | ReturnWithinDynamicScope) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -164,16 +160,14 @@ fn check_rca_for_callable_block_with_unreachable_binding() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -201,7 +195,7 @@ fn check_rca_for_callable_block_with_dynamic_unreachable_binding() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | ReturnWithinDynamicScope) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: adj: ctl: @@ -232,7 +226,7 @@ fn check_rca_for_test_callable() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: adj: ctl: @@ -247,42 +241,40 @@ fn check_rca_for_unrestricted_h() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "H", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -293,42 +285,40 @@ fn check_rca_for_base_h() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "H", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -339,54 +329,52 @@ fn check_rca_for_unrestricted_r1() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "R1", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -397,54 +385,52 @@ fn check_rca_for_base_r1() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "R1", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -455,54 +441,52 @@ fn check_rca_for_unrestricted_rx() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rx", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -513,54 +497,52 @@ fn check_rca_for_base_rx() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rx", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -571,66 +553,64 @@ fn check_rca_for_unrestricted_rxx() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rxx", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -641,66 +621,64 @@ fn check_rca_for_base_rxx() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rxx", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -711,54 +689,52 @@ fn check_rca_for_unrestricted_ry() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Ry", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -769,54 +745,52 @@ fn check_rca_for_base_ry() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Ry", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -827,66 +801,64 @@ fn check_rca_for_unrestricted_ryy() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Ryy", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -897,66 +869,64 @@ fn check_rca_for_base_ryy() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Ryy", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -967,54 +937,52 @@ fn check_rca_for_unrestricted_rz() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rz", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1025,54 +993,52 @@ fn check_rca_for_base_rz() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rz", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1083,66 +1049,64 @@ fn check_rca_for_unrestricted_rzz() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rzz", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1153,66 +1117,64 @@ fn check_rca_for_base_rzz() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Rzz", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1223,42 +1185,40 @@ fn check_rca_for_unrestricted_s() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "S", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1269,42 +1229,40 @@ fn check_rca_for_base_s() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "S", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1315,42 +1273,40 @@ fn check_rca_for_unrestricted_t() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "T", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1361,42 +1317,40 @@ fn check_rca_for_base_t() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "T", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1407,42 +1361,40 @@ fn check_rca_for_unrestricted_x() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "X", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1453,42 +1405,40 @@ fn check_rca_for_base_x() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "X", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1499,42 +1449,40 @@ fn check_rca_for_unrestricted_y() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Y", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1545,42 +1493,40 @@ fn check_rca_for_base_y() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Y", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1591,42 +1537,40 @@ fn check_rca_for_unrestricted_z() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Z", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } @@ -1637,41 +1581,39 @@ fn check_rca_for_base_z() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Z", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + value_kind: Static"#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/calls.rs b/source/compiler/qsc_rca/src/tests/calls.rs index 44eb31e870..bec4eb7421 100644 --- a/source/compiler/qsc_rca/src/tests/calls.rs +++ b/source/compiler/qsc_rca/src/tests/calls.rs @@ -50,7 +50,7 @@ fn check_rca_for_call_to_cyclic_function_with_dynamic_argument() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -76,7 +76,7 @@ fn check_rca_for_call_to_cyclic_operation_with_classical_argument() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | CallToCyclicOperation) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -103,7 +103,7 @@ fn check_rca_for_call_to_cyclic_operation_with_dynamic_argument() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | CallToCyclicOperation) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -147,7 +147,7 @@ fn check_rca_for_call_to_dynamic_closure_function() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | LoopWithDynamicCondition) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -171,7 +171,7 @@ fn check_rca_for_call_to_static_closure_operation() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -195,7 +195,7 @@ fn check_rca_for_call_to_dynamic_closure_operation() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -221,7 +221,7 @@ fn check_rca_for_call_to_operation_with_one_classical_return_and_one_dynamic_ret ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | ReturnWithinDynamicScope) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -249,7 +249,7 @@ fn check_rca_for_call_to_operation_with_codegen_intrinsic_override_treated_as_in ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -278,7 +278,7 @@ fn check_rca_for_call_to_operation_with_codegen_intrinsic_override_treated_as_in ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -321,7 +321,7 @@ fn check_rca_for_call_to_function_that_receives_tuple_with_a_non_tuple_dynamic_a ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -344,7 +344,7 @@ fn check_rca_for_call_to_function_passed_single_tuple_variable_for_multiple_args ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -367,7 +367,7 @@ fn check_rca_for_call_to_lambda_passed_single_tuple_variable_for_multiple_args() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/cycles.rs b/source/compiler/qsc_rca/src/tests/cycles.rs index d7a4759f34..c3219ec821 100644 --- a/source/compiler/qsc_rca/src/tests/cycles.rs +++ b/source/compiler/qsc_rca/src/tests/cycles.rs @@ -18,19 +18,17 @@ fn check_rca_for_one_function_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -51,38 +49,34 @@ fn check_rca_for_two_functions_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); check_callable_compute_properties( &compilation_context.fir_store, compilation_context.get_compute_properties(), "Bar", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -105,55 +99,49 @@ fn check_rca_for_three_functions_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); check_callable_compute_properties( &compilation_context.fir_store, compilation_context.get_compute_properties(), "Bar", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); check_callable_compute_properties( &compilation_context.fir_store, compilation_context.get_compute_properties(), "Baz", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -171,19 +159,17 @@ fn check_rca_for_indirect_function_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -203,19 +189,17 @@ fn check_rca_for_indirect_chain_function_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -233,19 +217,17 @@ fn check_rca_for_indirect_tuple_function_cycle() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -263,19 +245,17 @@ fn check_rca_for_function_cycle_within_binding() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -294,19 +274,17 @@ fn check_rca_for_function_cycle_within_assignment() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -323,19 +301,17 @@ fn check_rca_for_function_cycle_within_return() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -353,19 +329,17 @@ fn check_rca_for_function_cycle_within_tuple() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -408,29 +382,24 @@ fn check_rca_for_function_cycle_within_call_input() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "MySorted", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic [1]: [Parameter Type Array] ArrayParamApplication: - static_content_dynamic_size: Quantum: QuantumProperties: + static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_content_static_size: Quantum: QuantumProperties: + value_kind: Dynamic + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_content_dynamic_size: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -451,19 +420,17 @@ fn check_rca_for_function_cycle_within_if_block() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -484,19 +451,17 @@ fn check_rca_for_function_cycle_within_if_condition() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -516,19 +481,17 @@ fn check_rca_for_function_cycle_within_for_block() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -548,19 +511,17 @@ fn check_rca_for_function_cycle_within_while_block() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -579,19 +540,17 @@ fn check_rca_for_function_cycle_within_while_condition() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -608,25 +567,23 @@ fn check_rca_for_multi_param_recursive_bool_function() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -643,32 +600,27 @@ fn check_rca_for_multi_param_recursive_unit_function() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Array] ArrayParamApplication: - static_content_dynamic_size: Quantum: QuantumProperties: + static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) - dynamic_content_static_size: Quantum: QuantumProperties: + value_kind: Static + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) - dynamic_content_dynamic_size: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -685,21 +637,19 @@ fn check_rca_for_result_recursive_operation() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -716,30 +666,28 @@ fn check_rca_for_multi_param_result_recursive_operation() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic [3]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -761,11 +709,11 @@ fn check_rca_for_operation_body_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -795,19 +743,19 @@ fn check_rca_for_operation_body_adj_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static ctl: ctl-adj: "#]], ); @@ -836,20 +784,20 @@ fn check_rca_for_operation_body_ctl_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static ctl-adj: "#]], ); } @@ -877,20 +825,20 @@ fn check_rca_for_operation_multi_controlled_functor_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static ctl-adj: "#]], ); } @@ -913,11 +861,11 @@ fn check_rca_for_operation_body_recursion_non_unit_return() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -945,11 +893,11 @@ fn check_rca_for_operation_body_recursion_preserves_inherent_capabilities() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicQubit | CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -983,11 +931,11 @@ fn check_rca_for_two_operation_cycle() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1002,11 +950,11 @@ fn check_rca_for_two_operation_cycle() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + value_kind: Static adj: ctl: ctl-adj: "#]], diff --git a/source/compiler/qsc_rca/src/tests/ifs.rs b/source/compiler/qsc_rca/src/tests/ifs.rs index 42c9c1cf78..483ea12fef 100644 --- a/source/compiler/qsc_rca/src/tests/ifs.rs +++ b/source/compiler/qsc_rca/src/tests/ifs.rs @@ -22,16 +22,14 @@ fn check_rca_for_if_stmt_with_classic_condition_and_classic_if_true_block() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -52,18 +50,16 @@ fn check_rca_for_if_stmt_with_dynamic_condition_and_classic_if_true_block() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Foo", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -82,12 +78,10 @@ fn check_rca_for_if_else_expr_with_classic_condition_and_classic_branch_blocks() let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -107,13 +101,11 @@ fn check_rca_for_if_else_expr_with_dynamic_condition_and_classic_branch_blocks() let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/intrinsics.rs b/source/compiler/qsc_rca/src/tests/intrinsics.rs index ab3094d267..8293c43aaa 100644 --- a/source/compiler/qsc_rca/src/tests/intrinsics.rs +++ b/source/compiler/qsc_rca/src/tests/intrinsics.rs @@ -11,18 +11,16 @@ fn check_rca_for_quantum_rt_qubit_allocate() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__rt__qubit_allocate", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -33,21 +31,19 @@ fn check_rca_for_quantum_rt_qubit_release() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__rt__qubit_release", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -58,21 +54,19 @@ fn check_rca_for_quantum_qis_m_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__m__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -89,13 +83,10 @@ fn check_rca_for_length() { inherent: Classical dynamic_param_applications: [0]: [Parameter Type Array] ArrayParamApplication: - static_content_dynamic_size: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - value_kind: Element(Dynamic) - dynamic_content_static_size: Classical - dynamic_content_dynamic_size: Quantum: QuantumProperties: + static_size: Classical + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -109,21 +100,19 @@ fn check_rca_for_quantum_qis_mresetz_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__mresetz__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -134,19 +123,17 @@ fn check_rca_for_int_as_double() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "IntAsDouble", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -157,19 +144,17 @@ fn check_rca_for_int_as_big_int() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "IntAsBigInt", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -180,16 +165,14 @@ fn check_rca_for_dump_machine() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "DumpMachine", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -200,21 +183,19 @@ fn check_rca_for_check_zero() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "CheckZero", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -225,19 +206,17 @@ fn check_rca_for_message() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Message", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -248,19 +227,17 @@ fn check_rca_for_arc_cos() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "ArcCos", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -271,19 +248,17 @@ fn check_rca_for_arc_sin() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "ArcSin", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -294,19 +269,17 @@ fn check_rca_for_arc_tan() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "ArcTan", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -317,22 +290,20 @@ fn check_rca_for_arc_tan_2() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "ArcTan2", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -343,19 +314,17 @@ fn check_rca_for_cos() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Cos", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -366,19 +335,17 @@ fn check_rca_for_cosh() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Cosh", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -389,19 +356,17 @@ fn check_rca_for_sin() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Sin", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -412,19 +377,17 @@ fn check_rca_for_sinh() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Sinh", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -435,19 +398,17 @@ fn check_rca_for_tan() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Tan", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -458,19 +419,17 @@ fn check_rca_for_tanh() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Tanh", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -481,19 +440,17 @@ fn check_rca_for_sqrt() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Sqrt", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -504,19 +461,17 @@ fn check_rca_for_log() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Log", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -527,19 +482,17 @@ fn check_rca_for_truncate() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "Truncate", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -550,27 +503,25 @@ fn check_rca_for_quantum_qis_ccx_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__ccx__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -581,24 +532,22 @@ fn check_rca_for_quantum_qis_cx_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__cx__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -609,24 +558,22 @@ fn check_rca_for_quantum_qis_cy_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__cy__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -637,24 +584,22 @@ fn check_rca_for_quantum_qis_cz_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__cz__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -665,24 +610,22 @@ fn check_rca_for_quantum_qis_rx_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__rx__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -693,27 +636,25 @@ fn check_rca_for_quantum_qis_rxx_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__rxx__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -724,24 +665,22 @@ fn check_rca_for_quantum_qis_ry_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__ry__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -752,27 +691,25 @@ fn check_rca_for_quantum_qis_ryy_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__ryy__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -783,24 +720,22 @@ fn check_rca_for_quantum_qis_rz_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__rz__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -811,27 +746,25 @@ fn check_rca_for_quantum_qis_rzz_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__rzz__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -842,21 +775,19 @@ fn check_rca_for_quantum_qis_h_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__h__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -867,21 +798,19 @@ fn check_rca_for_quantum_qis_s_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__s__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -892,21 +821,19 @@ fn check_rca_for_quantum_qis_s_adj() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__s__adj", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -917,21 +844,19 @@ fn check_rca_for_quantum_qis_sx_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__sx__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -942,21 +867,19 @@ fn check_rca_for_quantum_qis_t_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__t__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -967,21 +890,19 @@ fn check_rca_for_quantum_qis_t_adj() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__t__adj", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -992,21 +913,19 @@ fn check_rca_for_quantum_qis_x_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__x__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1017,21 +936,19 @@ fn check_rca_for_quantum_qis_y_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__y__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1042,21 +959,19 @@ fn check_rca_for_quantum_qis_z_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__z__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1067,24 +982,22 @@ fn check_rca_for_quantum_qis_swap_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__swap__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1095,21 +1008,19 @@ fn check_rca_for_quantum_qis_reset_body() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "__quantum__qis__reset__body", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1120,24 +1031,22 @@ fn check_rca_for_draw_random_int() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "DrawRandomInt", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1148,24 +1057,22 @@ fn check_rca_for_draw_random_double() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "DrawRandomDouble", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1176,21 +1083,19 @@ fn check_rca_for_draw_random_bool() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "DrawRandomBool", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1201,22 +1106,20 @@ fn check_rca_for_begin_estimate_caching() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "BeginEstimateCaching", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - value_kind: Element(Dynamic) + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + value_kind: Dynamic adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1227,16 +1130,14 @@ fn check_rca_for_end_estimate_caching() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "EndEstimateCaching", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Classical dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1252,31 +1153,25 @@ fn check_rca_for_account_for_estimates_internal() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Array] ArrayParamApplication: - static_content_dynamic_size: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Element(Static) - dynamic_content_static_size: Quantum: QuantumProperties: + static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Static) - dynamic_content_dynamic_size: Quantum: QuantumProperties: + value_kind: Static + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Element(Static) + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Static) + value_kind: Static [2]: [Parameter Type Array] ArrayParamApplication: - static_content_dynamic_size: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit | UseOfDynamicallySizedArray) - value_kind: Element(Static) - dynamic_content_static_size: Quantum: QuantumProperties: + static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) - dynamic_content_dynamic_size: Quantum: QuantumProperties: + value_kind: Static + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit | UseOfDynamicallySizedArray) - value_kind: Element(Static) + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1290,21 +1185,19 @@ fn check_rca_for_begin_repeat_estimates_internal() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "BeginRepeatEstimatesInternal", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Static) + value_kind: Static adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -1315,17 +1208,15 @@ fn check_rca_for_end_repeat_estimates_internal() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "EndRepeatEstimatesInternal", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/lambdas.rs b/source/compiler/qsc_rca/src/tests/lambdas.rs index 7be61070cd..20bbd2a191 100644 --- a/source/compiler/qsc_rca/src/tests/lambdas.rs +++ b/source/compiler/qsc_rca/src/tests/lambdas.rs @@ -141,7 +141,7 @@ fn check_rca_for_dynamic_lambda_two_classical_parameters_one_dynamic_capture() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -170,7 +170,7 @@ fn check_rca_for_dynamic_lambda_two_dynamic_parameters_one_classical_capture() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -191,7 +191,7 @@ fn check_rca_for_operation_lambda_two_parameters() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -213,7 +213,7 @@ fn check_rca_for_operation_lambda_two_parameters_with_controls() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/loops.rs b/source/compiler/qsc_rca/src/tests/loops.rs index 7fe646dd03..f0cb89ca59 100644 --- a/source/compiler/qsc_rca/src/tests/loops.rs +++ b/source/compiler/qsc_rca/src/tests/loops.rs @@ -16,12 +16,10 @@ fn check_rca_for_classical_for_loop() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -39,14 +37,12 @@ fn check_rca_for_dynamic_for_loop() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" - ApplicationsGeneratorSet: - inherent: Quantum: QuantumProperties: - runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | LoopWithDynamicCondition) - value_kind: Element(Static) - dynamic_param_applications: "# - ], + &expect![[r#" + ApplicationsGeneratorSet: + inherent: Quantum: QuantumProperties: + runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | LoopWithDynamicCondition) + value_kind: Static + dynamic_param_applications: "#]], ); } @@ -63,12 +59,10 @@ fn check_rca_for_classical_repeat_until_loop() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -91,7 +85,7 @@ fn check_rca_for_dynamic_repeat_until_loop_with_initial_dynamic_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | LoopWithDynamicCondition) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -118,7 +112,7 @@ fn check_rca_for_dynamic_repeat_until_loop_with_initial_classical_condition_and_ ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition | UseOfDynamicResult) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -141,7 +135,7 @@ fn check_rca_for_dynamic_repeat_until_loop_with_measurement_in_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -169,7 +163,7 @@ fn check_rca_for_dynamic_repeat_until_loop_with_initial_classical_condition_and_ ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition | UseOfDynamicResult) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -186,12 +180,10 @@ fn check_rca_for_classical_while_loop() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -213,7 +205,7 @@ fn check_rca_for_dynamic_while_loop_with_initial_dynamic_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | LoopWithDynamicCondition) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -239,7 +231,7 @@ fn check_rca_for_dynamic_while_loop_with_initial_classical_condition_and_measure ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition | UseOfDynamicResult) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -261,7 +253,7 @@ fn check_rca_for_dynamic_while_loop_with_measurement_in_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -290,7 +282,7 @@ fn check_rca_for_dynamic_while_loop_with_initial_classical_condition_and_dynamic ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition | UseOfDynamicResult) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } @@ -318,7 +310,7 @@ fn check_rca_for_dynamic_while_loop_with_assignments_in_both_the_condition_and_t ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition | UseOfDynamicResult) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/measurements.rs b/source/compiler/qsc_rca/src/tests/measurements.rs index b1ab2f0160..2663ad15df 100644 --- a/source/compiler/qsc_rca/src/tests/measurements.rs +++ b/source/compiler/qsc_rca/src/tests/measurements.rs @@ -15,14 +15,12 @@ fn check_rca_for_static_single_qubit_measurement() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -45,7 +43,7 @@ fn check_rca_for_dynamic_single_measurement() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(MeasurementWithinDynamicScope | UseOfDynamicResult) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -62,14 +60,12 @@ fn check_rca_for_static_single_measurement_and_reset() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -93,7 +89,7 @@ fn check_rca_for_dynamic_single_measurement_and_reset() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(MeasurementWithinDynamicScope | UseOfDynamicResult) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -110,13 +106,11 @@ fn check_rca_for_static_multi_qubit_measurement() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Dynamic, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/overrides.rs b/source/compiler/qsc_rca/src/tests/overrides.rs index db59b20ece..84d4b77fb2 100644 --- a/source/compiler/qsc_rca/src/tests/overrides.rs +++ b/source/compiler/qsc_rca/src/tests/overrides.rs @@ -53,7 +53,7 @@ fn check_rca_for_length_of_dynamically_sized_array_with_static_content() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -76,7 +76,7 @@ fn check_rca_for_length_of_dynamically_sized_array_with_dynamic_content() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Element(Dynamic) + value_kind: Dynamic dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/qubits.rs b/source/compiler/qsc_rca/src/tests/qubits.rs index c60335cd6a..77164c99e2 100644 --- a/source/compiler/qsc_rca/src/tests/qubits.rs +++ b/source/compiler/qsc_rca/src/tests/qubits.rs @@ -17,14 +17,12 @@ fn check_rca_for_static_single_qubit_allcation() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) - dynamic_param_applications: "# - ], + value_kind: Static + dynamic_param_applications: "#]], ); } @@ -48,18 +46,16 @@ fn check_rca_for_dynamic_single_qubit_allcation() { &compilation_context.fir_store, compilation_context.get_compute_properties(), "DynamicSingleQubitAllocation", - &expect![ - r#" + &expect![[r#" Callable: CallableComputeProperties: body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicQubit) - value_kind: Element(Static) + value_kind: Static dynamic_param_applications: adj: ctl: - ctl-adj: "# - ], + ctl-adj: "#]], ); } @@ -74,14 +70,12 @@ fn check_rca_for_static_multi_qubit_allcation() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Array(Content: Static, Size: Static) - dynamic_param_applications: "# - ], + value_kind: Static + dynamic_param_applications: "#]], ); } @@ -98,13 +92,11 @@ fn check_rca_for_dynamic_multi_qubit_allcation() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | UseOfDynamicQubit | UseOfDynamicallySizedArray | LoopWithDynamicCondition) - value_kind: Array(Content: Dynamic, Size: Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/strings.rs b/source/compiler/qsc_rca/src/tests/strings.rs index 30d140a2df..d6e3087ffe 100644 --- a/source/compiler/qsc_rca/src/tests/strings.rs +++ b/source/compiler/qsc_rca/src/tests/strings.rs @@ -11,12 +11,10 @@ fn check_rca_for_classical_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -31,14 +29,12 @@ fn check_rca_for_dynamic_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -49,12 +45,10 @@ fn check_rca_for_classical_interpolated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -69,14 +63,12 @@ fn check_rca_for_dynamic_interpolated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -87,12 +79,10 @@ fn check_rca_for_classical_nested_interpolated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -107,14 +97,12 @@ fn check_rca_for_dynamic_nested_interpolated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -125,12 +113,10 @@ fn check_rca_for_classical_concatenated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -146,14 +132,12 @@ fn check_rca_for_dynamic_concatenated_string() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -164,12 +148,10 @@ fn check_rca_for_classical_string_comparison() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -184,13 +166,11 @@ fn check_rca_for_dynamic_string_comparison() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/structs.rs b/source/compiler/qsc_rca/src/tests/structs.rs index c26c7552fa..83c0775cd1 100644 --- a/source/compiler/qsc_rca/src/tests/structs.rs +++ b/source/compiler/qsc_rca/src/tests/structs.rs @@ -15,12 +15,10 @@ fn check_rca_for_struct_constructor_with_classical_values() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -37,14 +35,12 @@ fn check_rca_for_struct_constructor_with_a_dynamic_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -60,12 +56,10 @@ fn check_rca_for_struct_copy_constructor_with_classical_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -83,14 +77,12 @@ fn check_rca_for_struct_copy_constructor_with_dynamic_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -108,13 +100,11 @@ fn check_rca_for_struct_dynamic_constructor_overwritten_with_classic_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/types.rs b/source/compiler/qsc_rca/src/tests/types.rs index f9142fc27e..89d208e888 100644 --- a/source/compiler/qsc_rca/src/tests/types.rs +++ b/source/compiler/qsc_rca/src/tests/types.rs @@ -11,12 +11,10 @@ fn check_rca_for_classical_result() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -31,14 +29,12 @@ fn check_rca_for_dynamic_result() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -49,12 +45,10 @@ fn check_rca_for_classical_bool() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -70,14 +64,12 @@ fn check_rca_for_dynamic_bool() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -88,12 +80,10 @@ fn check_rca_for_classical_int() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -111,14 +101,12 @@ fn check_rca_for_dynamic_int() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -129,12 +117,10 @@ fn check_rca_for_classical_pauli() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -149,14 +135,12 @@ fn check_rca_for_dynamic_pauli() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicPauli) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -167,12 +151,10 @@ fn check_rca_for_classical_range() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -188,14 +170,12 @@ fn check_rca_for_dynamic_range() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -206,12 +186,10 @@ fn check_rca_for_classical_double() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -230,14 +208,12 @@ fn check_rca_for_dynamic_double() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -248,12 +224,10 @@ fn check_rca_for_classical_big_int() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -268,13 +242,11 @@ fn check_rca_for_dynamic_big_int() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicBigInt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/udts.rs b/source/compiler/qsc_rca/src/tests/udts.rs index 282370c288..01d835fa8b 100644 --- a/source/compiler/qsc_rca/src/tests/udts.rs +++ b/source/compiler/qsc_rca/src/tests/udts.rs @@ -15,12 +15,10 @@ fn check_rca_for_udt_constructor_with_classical_values() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -37,14 +35,12 @@ fn check_rca_for_udt_constructor_with_a_dynamic_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } @@ -61,12 +57,10 @@ fn check_rca_for_udt_field_update_with_classical_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -85,13 +79,11 @@ fn check_rca_for_udt_field_update_with_dynamic_value() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/vars.rs b/source/compiler/qsc_rca/src/tests/vars.rs index c646a7226f..f312672a91 100644 --- a/source/compiler/qsc_rca/src/tests/vars.rs +++ b/source/compiler/qsc_rca/src/tests/vars.rs @@ -11,12 +11,10 @@ fn check_rca_for_callable_var() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -31,12 +29,10 @@ fn check_rca_for_udt_var() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -51,12 +47,10 @@ fn check_rca_for_static_int_var() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Classical - dynamic_param_applications: "# - ], + dynamic_param_applications: "#]], ); } @@ -71,14 +65,12 @@ fn check_rca_for_static_qubit_var() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) - dynamic_param_applications: "# - ], + value_kind: Static + dynamic_param_applications: "#]], ); } @@ -94,13 +86,11 @@ fn check_rca_for_dynamic_result_var() { let package_store_compute_properties = compilation_context.get_compute_properties(); check_last_statement_compute_properties( package_store_compute_properties, - &expect![ - r#" + &expect![[r#" ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Dynamic) - dynamic_param_applications: "# - ], + value_kind: Dynamic + dynamic_param_applications: "#]], ); }