From 7a3ce784aa0e2efce8ab369252dc10b4c9727d08 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Wed, 7 Jan 2026 11:54:50 -0800 Subject: [PATCH 1/2] Refactor RCA, part 1 This is the first part of a refactoring for Runtime Capabailities Analysis (RCA) internals. This is meant to simplify the internals by removing some elements that are no longer used, simplifying some parts, and preparing for later renaming and feature work. In particular, this includes: - Removal of the `ValueKind` struct that differentiated between elements and arrays. - Use `RuntimeFeatureFlags::UseOfDynamicallySizedArray` more consistently to identify places where arrays are dynamic. - Propagate `RuntimeFeatureFlags` via increased use of `ComputeKind` struct. - Simplify array related `ApplicationInstance` entries to drop distinction between dynamic and static content. - Update RCA tests for changes in structure. Note that for the test updates, the `value_kind` field changes to `runtime_kind` but the actual content of the field (static vs dynamic) and importantly the `runtime_features` do NOT change, showing that the refactor did not affect the behavior of these tests. The one exception is a new test case in arrays that shows an indirect call to the `Length` intrinsic with a dynamically sized array now correctly reflects the output as a dynamic integer, which was a pre-existing subtle propagation bug fixed during refactor. --- .../src/evaluation_context.rs | 69 +- source/compiler/qsc_partial_eval/src/lib.rs | 12 +- source/compiler/qsc_rca/src/applications.rs | 154 ++-- source/compiler/qsc_rca/src/core.rs | 515 ++++++------- .../compiler/qsc_rca/src/cyclic_callables.rs | 20 +- source/compiler/qsc_rca/src/lib.rs | 302 ++------ source/compiler/qsc_rca/src/overrider.rs | 105 +-- source/compiler/qsc_rca/src/tests/arrays.rs | 157 ++-- source/compiler/qsc_rca/src/tests/assigns.rs | 64 +- source/compiler/qsc_rca/src/tests/bindings.rs | 56 +- source/compiler/qsc_rca/src/tests/binops.rs | 56 +- .../compiler/qsc_rca/src/tests/callables.rs | 708 ++++++++---------- source/compiler/qsc_rca/src/tests/calls.rs | 24 +- source/compiler/qsc_rca/src/tests/cycles.rs | 266 +++---- source/compiler/qsc_rca/src/tests/ifs.rs | 28 +- .../compiler/qsc_rca/src/tests/intrinsics.rs | 527 ++++++------- source/compiler/qsc_rca/src/tests/lambdas.rs | 8 +- source/compiler/qsc_rca/src/tests/loops.rs | 50 +- .../qsc_rca/src/tests/measurements.rs | 28 +- .../compiler/qsc_rca/src/tests/overrides.rs | 4 +- source/compiler/qsc_rca/src/tests/qubits.rs | 32 +- source/compiler/qsc_rca/src/tests/strings.rs | 70 +- source/compiler/qsc_rca/src/tests/structs.rs | 36 +- source/compiler/qsc_rca/src/tests/types.rs | 98 +-- source/compiler/qsc_rca/src/tests/udts.rs | 28 +- source/compiler/qsc_rca/src/tests/vars.rs | 34 +- 26 files changed, 1386 insertions(+), 2065 deletions(-) diff --git a/source/compiler/qsc_partial_eval/src/evaluation_context.rs b/source/compiler/qsc_partial_eval/src/evaluation_context.rs index bcd6aeab3e..f3a56fdb41 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, RuntimeKind}; 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_runtime_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, @@ -285,40 +288,28 @@ 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; +fn map_eval_value_to_runtime_kind(value: &Value) -> RuntimeKind { + match value { + Value::Array(elements) => { + for element in elements.iter() { + let element_runtime_kind = map_eval_value_to_runtime_kind(element); + if element_runtime_kind == RuntimeKind::Dynamic { + return RuntimeKind::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; - } + RuntimeKind::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_runtime_kind(element); + if element_runtime_kind == RuntimeKind::Dynamic { + return RuntimeKind::Dynamic; + } + } + RuntimeKind::Static } + Value::Result(Result::Id(_) | Result::Loss) | Value::Var(_) => RuntimeKind::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(_) => RuntimeKind::Static, } } diff --git a/source/compiler/qsc_partial_eval/src/lib.rs b/source/compiler/qsc_partial_eval/src/lib.rs index 58595ce8bb..0be09e171d 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, RuntimeKind, errors::{ Error as CapabilityError, generate_errors_from_runtime_features, get_missing_runtime_features, @@ -1505,7 +1505,7 @@ impl<'a> PartialEvaluator<'a> { let call_compute_kind = self.get_call_compute_kind(call_scope); if let ComputeKind::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }) = call_compute_kind { let missing_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 runtime_kind == RuntimeKind::Dynamic { return Err(Error::UnexpectedDynamicValue( self.get_expr_package_span(call_expr_id), )); @@ -2216,7 +2216,7 @@ impl<'a> PartialEvaluator<'a> { ComputeKind::Classical | ComputeKind::Quantum(QuantumProperties { runtime_features: _, - value_kind: ValueKind::Element(RuntimeKind::Static), + runtime_kind: RuntimeKind::Static, }) ), "loop conditions must be purely classical" @@ -2636,7 +2636,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 +2677,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..062320064d 100644 --- a/source/compiler/qsc_rca/src/applications.rs +++ b/source/compiler/qsc_rca/src/applications.rs @@ -3,7 +3,6 @@ use crate::{ ApplicationGeneratorSet, ComputeKind, QuantumProperties, RuntimeFeatureFlags, RuntimeKind, - ValueKind, common::{Local, LocalKind, LocalsLookup, initialize_locals_map}, scaffolding::InternalPackageComputeProperties, }; @@ -58,7 +57,10 @@ impl GeneratorSetsBuilder { return_type, Some(( input_param.index, - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Dynamic), + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::UseOfDynamicallySizedArray, + RuntimeKind::Dynamic, + ), )), ); let dynamic_content_static_size = ApplicationInstance::new( @@ -67,7 +69,10 @@ impl GeneratorSetsBuilder { return_type, Some(( input_param.index, - ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Static), + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::empty(), + RuntimeKind::Dynamic, + ), )), ); let dynamic_content_dynamic_size = ApplicationInstance::new( @@ -76,7 +81,10 @@ impl GeneratorSetsBuilder { return_type, Some(( input_param.index, - ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Dynamic), + ComputeKind::new_with_runtime_features( + RuntimeFeatureFlags::UseOfDynamicallySizedArray, + RuntimeKind::Dynamic, + ), )), ); vec![ @@ -91,7 +99,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(), + RuntimeKind::Dynamic, + ), + )), )] } }; @@ -168,14 +182,15 @@ impl GeneratorSetsBuilder { == dynamic_param_applications_compute_properties.len() ); - // Update the value kind of the generator's inherent compute kind. - if let Some(inherent_value_kind) = inherent_application_compute_properties.value_kind { + // Update the runtime kind of the generator's inherent compute kind. + if let Some(inherent_value_kind) = inherent_application_compute_properties.runtime_kind + { applications_generator .inherent - .aggregate_value_kind(inherent_value_kind); + .aggregate_runtime_kind(inherent_value_kind); } - // Update the value kind of the generator's param applications. + // Update the runtime kind of the generator's param applications. for (param_application, compute_properties) in applications_generator .dynamic_param_applications .iter_mut() @@ -204,31 +219,22 @@ impl GeneratorSetsBuilder { panic!("expected an array param application"); }; array_compute_properties - .static_content_dynamic_size - .value_kind - .iter() - .for_each(|value_kind| { - array_param_application - .static_content_dynamic_size - .aggregate_value_kind(*value_kind); - }); - array_compute_properties - .dynamic_content_static_size - .value_kind + .static_size + .runtime_kind .iter() - .for_each(|value_kind| { + .for_each(|runtime_kind| { array_param_application - .dynamic_content_static_size - .aggregate_value_kind(*value_kind); + .static_size + .aggregate_runtime_kind(*runtime_kind); }); array_compute_properties - .dynamic_content_dynamic_size - .value_kind + .dynamic_size + .runtime_kind .iter() - .for_each(|value_kind| { + .for_each(|runtime_kind| { array_param_application - .dynamic_content_dynamic_size - .aggregate_value_kind(*value_kind); + .dynamic_size + .aggregate_runtime_kind(*runtime_kind); }); } crate::ParamApplication::Element(element_param_application) => { @@ -238,10 +244,10 @@ impl GeneratorSetsBuilder { panic!("expected an element param application"); }; element_compute_properties - .value_kind + .runtime_kind .iter() .for_each(|value_kind| { - element_param_application.aggregate_value_kind(*value_kind); + element_param_application.aggregate_runtime_kind(*value_kind); }); } } @@ -276,24 +282,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 +463,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 +472,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), + runtime_kind: RuntimeKind::Static, }); locals_map.insert( controls.var, @@ -492,13 +491,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( @@ -522,23 +518,23 @@ 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(); + // Determine the runtime kind of the application instance by going through each return expression aggregating + // their runtime kind (if any). + let mut runtime_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); - // There are two scenarios in which a value kind is considered, and both of them only happen if the return + // There are two scenarios in which a runtime kind is considered, and both of them only happen if the return // expression is quantum. if let ComputeKind::Quantum(return_quantum_properties) = return_expr_compute_kind { let return_value_kind = if return_quantum_properties .runtime_features .contains(RuntimeFeatureFlags::ReturnWithinDynamicScope) { - // The return expression happens within a dynamic scope so the value kind is dynamic. - ValueKind::new_dynamic_from_type(&self.return_type) + // The return expression happens within a dynamic scope so the runtime kind is dynamic. + RuntimeKind::new_dynamic_from_type(&self.return_type) } else { - // What we actually want here is the value kind of the returned value expression. + // What we actually want here is the runtime kind of the returned value expression. let returned_value_expr_compute_kind = self.get_expr_compute_kind(returned_value_expr_id); let ComputeKind::Quantum(returned_value_quantum_properties) = @@ -546,29 +542,25 @@ impl ApplicationInstance { else { panic!("returned value expression is expected to be quantum"); }; - returned_value_quantum_properties.value_kind + returned_value_quantum_properties.runtime_kind }; - value_kinds.push(return_value_kind); + runtime_kinds.push(return_value_kind); } } - // An application instance does not always have a value kind, only when there is at least one quantum return + // An application instance does not always have a runtime kind, only when there is at least one quantum return // expression. - let value_kind = if value_kinds.is_empty() { + let runtime_kind = if runtime_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 value_kind = value_kinds.iter().fold( - initial_value_kind, - |aggregated_value_kind, return_value_kind| { - aggregated_value_kind.aggregate(*return_value_kind) + let initial_runtime_kind = RuntimeKind::Static; + let runtime_kind = runtime_kinds.iter().fold( + initial_runtime_kind, + |aggregated_runtime_kind, return_runtime_kind| { + aggregated_runtime_kind.aggregate(*return_runtime_kind) }, ); - Some(value_kind) + Some(runtime_kind) }; ApplicationInstanceComputeProperties { @@ -576,7 +568,7 @@ impl ApplicationInstance { stmts: self.stmts, exprs: self.exprs, unresolved_callee_exprs: self.unresolved_callee_exprs, - value_kind, + runtime_kind, } } } @@ -650,7 +642,7 @@ struct ApplicationInstanceComputeProperties { blocks: FxHashMap, stmts: FxHashMap, exprs: FxHashMap, - value_kind: Option, + runtime_kind: Option, unresolved_callee_exprs: Vec, } @@ -695,16 +687,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 +700,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..2070ffc15d 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, RuntimeKind, 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_runtime_kind = RuntimeKind::Static; let mut compute_kind = ComputeKind::Classical; let mut has_dynamic_content = false; for expr_id in exprs { @@ -70,13 +70,10 @@ 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, default_runtime_kind); 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.runtime_kind = RuntimeKind::Dynamic; } compute_kind @@ -100,17 +96,17 @@ 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_runtime_kind = RuntimeKind::Static; let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(size_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(size_expr_compute_kind, default_runtime_kind); compute_kind = - compute_kind.aggregate_runtime_features(value_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(value_expr_compute_kind, default_runtime_kind); if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { // If the array is dynamic, it requires an additional runtime feature. @@ -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); + quantum_properties.runtime_kind = + if value_expr_compute_kind.is_dynamic() || size_expr_compute_kind.is_dynamic() { + RuntimeKind::Dynamic + } else { + RuntimeKind::Static + }; } compute_kind @@ -153,15 +139,15 @@ impl<'a> Analyzer<'a> { // the value expression. let updated_compute_kind = self.update_locals_compute_kind(assignee_expr_id, value_expr_id); - // We do not care about the value kind for this kind of expression because it is an assignment, but we still + // We do not care about the runtime 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_runtime_kind = RuntimeKind::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 // associated to the local variable. compute_kind = - compute_kind.aggregate_runtime_features(updated_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(updated_compute_kind, default_runtime_kind); compute_kind } @@ -182,24 +168,23 @@ 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_runtime_kind = RuntimeKind::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_runtime_kind = RuntimeKind::Dynamic; replacement_value_compute_kind = replacement_value_compute_kind.aggregate(ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicallySizedArray, - ValueKind::new_static_from_type(replacement_ty), + RuntimeKind::Static, )); } let mut updated_compute_kind = ComputeKind::Classical; updated_compute_kind = updated_compute_kind - .aggregate_runtime_features(replacement_value_compute_kind, default_value_kind); + .aggregate_runtime_features(replacement_value_compute_kind, default_runtime_kind); - // If the replacement value expression is dynamic, the runtime features and value kind of the update have to + // If the replacement value expression is dynamic, the runtime features and runtime kind of the update have to // take this into account. if replacement_value_compute_kind.is_dynamic() { let ComputeKind::Quantum(quantum_properties) = &mut updated_compute_kind else { @@ -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.runtime_kind = RuntimeKind::Dynamic; } // Update the compute kind of the local variable in the locals map. @@ -228,24 +208,24 @@ impl<'a> Analyzer<'a> { // The compute kind of this expression is determined by aggregating the runtime features of the index and // replacement expressions. - // We do not care about the value kind for this kind of expression because it is an assignment, but we still + // We do not care about the runtime 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_runtime_kind = RuntimeKind::Static; let index_compute_kind = *application_instance.get_expr_compute_kind(index_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(index_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(index_compute_kind, default_runtime_kind); compute_kind = compute_kind - .aggregate_runtime_features(replacement_value_compute_kind, default_value_kind); + .aggregate_runtime_features(replacement_value_compute_kind, default_runtime_kind); // Finally, if the index expression is dynamic, we aggregate an additional runtime feature. if index_compute_kind.is_dynamic() { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicIndex, - default_value_kind, + default_runtime_kind, ), - default_value_kind, + default_runtime_kind, ); } compute_kind @@ -271,7 +251,7 @@ impl<'a> Analyzer<'a> { // Additionally, since the new compute kind can be of a different type than its operands (e.g. 1 == 1), // aggregate additional runtime features depending on the binary operator expression's type (if it's dynamic). - if let Some(value_kind) = compute_kind.value_kind() { + if let Some(value_kind) = compute_kind.runtime_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of 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), + RuntimeKind::Static, ), - ValueKind::Element(RuntimeKind::Static), + RuntimeKind::Static, ); } @@ -335,12 +315,12 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let callee_expr_compute_kind = *application_instance.get_expr_compute_kind(callee_expr_id); let mut compute_kind = if callee_expr_compute_kind.is_dynamic() { - // The value kind of a call expression with an dynamic callee is dynamic but its specific variant depends + // The runtime kind of a call expression with an dynamic callee is dynamic but its specific variant depends // on the expression's type. - let value_kind = ValueKind::new_dynamic_from_type(expr_type); + let runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToDynamicCallee, - value_kind, + runtime_kind, }) } else { let call_compute_kind = @@ -354,15 +334,14 @@ 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. if let Ty::Prim(Prim::Qubit) = expr_type { - // We consider this qubit dynamic so the value kind of this expression must be dynamic. + // We consider this qubit dynamic so the runtime 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), + runtime_kind: RuntimeKind::Dynamic, })); } @@ -370,15 +349,15 @@ impl<'a> Analyzer<'a> { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::MeasurementWithinDynamicScope, - default_value_kind, + RuntimeKind::Static, ), - default_value_kind, + RuntimeKind::Static, ); } } // If the call expression is dynamic, aggregate the corresponding runtime features depending on its type. - if let Some(value_kind) = compute_kind.value_kind() { + if let Some(value_kind) = compute_kind.runtime_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of Compute Kind"); }; @@ -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, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(args_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(args_expr_compute_kind, RuntimeKind::Static); compute_kind } @@ -408,7 +387,7 @@ impl<'a> Analyzer<'a> { { ComputeKind::new_with_runtime_features( quantum_properties.runtime_features, - ValueKind::Element(RuntimeKind::Dynamic), + RuntimeKind::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. @@ -457,8 +435,8 @@ 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 { + // Derive the compute kind based on the runtime kind of the arguments. + 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,32 +447,31 @@ 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_runtime_kind = RuntimeKind::Static; for control_expr in args_controls { let control_expr_compute_kind = *application_instance.get_expr_compute_kind(control_expr); compute_kind = compute_kind - .aggregate_runtime_features(control_expr_compute_kind, default_value_kind); + .aggregate_runtime_features(control_expr_compute_kind, default_runtime_kind); has_dynamic_controls |= control_expr_compute_kind.is_dynamic(); } // If any of the control expressions is dynamic, set the compute kind of the call expression to the // corresponding dynamic variant. if has_dynamic_controls { - let value_kind = ValueKind::new_dynamic_from_type(&callable_decl.output); - compute_kind.aggregate_value_kind(value_kind); + let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_decl.output); + compute_kind.aggregate_runtime_kind(runtime_kind); } // To distinguish between a cyclic operation and a call to a cyclic operation, replace the cyclic operation @@ -512,19 +489,19 @@ impl<'a> Analyzer<'a> { .insert(RuntimeFeatureFlags::CallToCyclicOperation); } - // If the callable output has type parameters, there might be a discrepancy in the value kind variant we derive - // from the application generator set and the value kind variant that corresponds to the call expression type. + // If the callable output has type parameters, there might be a discrepancy in the runtime kind variant we derive + // from the application generator set and the runtime kind variant that corresponds to the call expression type. // Fix that discrepancy here. if callable_decl.output.has_type_parameters() && let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { - // Create a default value kind for the call expression type just to know which variant we should map to. + // Create a default runtime 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 = RuntimeKind::Static; quantum_properties - .value_kind - .project_onto_variant(&mut mapped_value_kind); - quantum_properties.value_kind = mapped_value_kind; + .runtime_kind + .project_onto_variant(&mut mapped_runtime_kind); + quantum_properties.runtime_kind = mapped_runtime_kind; } CallComputeKind::Regular(compute_kind) } @@ -548,13 +525,12 @@ impl<'a> Analyzer<'a> { // If the callee could not be resolved, return a compute kind with certain runtime features. let (Some(callee), fixed_args) = maybe_callee else { - // The value kind of a call expression with an unresolved callee is not known, so to avoid + // The runtime 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, + runtime_kind: RuntimeKind::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), + runtime_kind: RuntimeKind::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, RuntimeKind::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_runtime_kind(RuntimeKind::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, RuntimeKind::Static); compute_kind } @@ -646,18 +619,18 @@ impl<'a> Analyzer<'a> { self.visit_expr(record_expr_id); // The compute kind of the field expression is determined from the runtime features of the record expression and - // the value kind adapted to the expression's type. + // the runtime 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() { - ValueKind::new_dynamic_from_type(expr_type) + let runtime_kind = if record_expr_compute_kind.is_dynamic() { + RuntimeKind::new_dynamic_from_type(expr_type) } else { - ValueKind::new_static_from_type(expr_type) + RuntimeKind::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); + .aggregate_runtime_features(condition_expr_compute_kind, RuntimeKind::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, RuntimeKind::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, RuntimeKind::Static); } // If any of the sub-expressions is dynamic, then the compute kind of an if-expression is dynamic and additional @@ -723,36 +695,34 @@ impl<'a> Analyzer<'a> { || otherwise_expr_id .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 - }, - ) + let dynamic_runtime_kind = if matches!(expr_type, Ty::Array(..)) { + // An array coming from a dynamic conditional should be treated as dynamic. + RuntimeKind::Dynamic } else { - ValueKind::new_dynamic_from_type(expr_type) + RuntimeKind::new_dynamic_from_type(expr_type) }; let mut dynamic_runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - dynamic_value_kind, + dynamic_runtime_kind, expr_type, ); if condition_expr_compute_kind.is_dynamic() { 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 { runtime_features: dynamic_runtime_features, - value_kind: dynamic_value_kind, + runtime_kind: dynamic_runtime_kind, }); compute_kind = compute_kind.aggregate(dynamic_compute_kind); } @@ -775,47 +745,36 @@ 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, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, RuntimeKind::Static); - // If the index expression is dynamic, the value kind of the expression is also dynamic and an additional + // If the index expression is dynamic, the runtime 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.runtime_kind == RuntimeKind::Dynamic + { + let dynamic_runtime_features = RuntimeFeatureFlags::UseOfDynamicIndex; + let dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); + compute_kind = compute_kind.aggregate(ComputeKind::Quantum(QuantumProperties { + runtime_features: dynamic_runtime_features, + runtime_kind: dynamic_runtime_kind, + })); } - // The value kind of the access by index expression also depends on whether the content of the array expression + // The runtime 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.runtime_kind == RuntimeKind::Dynamic + { + let dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); + compute_kind.aggregate_runtime_kind(dynamic_runtime_kind); } // If the index expression is dynamic, aggregate the corresponding runtime features depending on its type. - if let Some(value_kind) = compute_kind.value_kind() { + if let Some(value_kind) = compute_kind.runtime_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of Compute Kind"); }; @@ -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, + RuntimeKind::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), + runtime_kind: RuntimeKind::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, RuntimeKind::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, RuntimeKind::Static); has_dynamic_sub_exprs |= expr_compute_kind.is_dynamic(); } @@ -919,20 +874,20 @@ 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, RuntimeKind::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_runtime_kind(RuntimeKind::Dynamic); } // If the constructor is dynamic, aggregate the corresponding runtime features depending on its type. if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { quantum_properties.runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( - quantum_properties.value_kind, + quantum_properties.runtime_kind, expr_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, RuntimeKind::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.runtime_kind = RuntimeKind::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, RuntimeKind::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_runtime_kind(RuntimeKind::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, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(replace_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(replace_expr_compute_kind, RuntimeKind::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_runtime_kind(RuntimeKind::Dynamic); } compute_kind @@ -1055,36 +1007,33 @@ 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, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, RuntimeKind::Static); compute_kind = compute_kind - .aggregate_runtime_features(replacement_value_expr_compute_kind, default_value_kind); - + .aggregate_runtime_features(replacement_value_expr_compute_kind, RuntimeKind::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, + runtime_kind: RuntimeKind::Static, }); compute_kind = compute_kind - .aggregate_runtime_features(additional_compute_kind, default_value_kind); + .aggregate_runtime_features(additional_compute_kind, RuntimeKind::Static); } - // The value kind of the update index expression is based on the value kind of the array expression. + // The runtime kind of the update index expression is based on the runtime kind of the array expression. if let ComputeKind::Quantum(array_quantum_properties) = array_expr_compute_kind { - compute_kind.aggregate_value_kind(array_quantum_properties.value_kind); + compute_kind.aggregate_runtime_kind(array_quantum_properties.runtime_kind); } // If either the index or the replacement value expressions are dynamic, then the content of the resulting array // 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_runtime_kind(RuntimeKind::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); + .aggregate_runtime_features(condition_expr_compute_kind, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(block_compute_kind, default_value_kind); + compute_kind.aggregate_runtime_features(block_compute_kind, RuntimeKind::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), + runtime_kind: RuntimeKind::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 { @@ -1583,42 +1526,40 @@ impl<'a> Analyzer<'a> { ); let mut updated_compute_kind = local_var_compute_kind.compute_kind; - // Since the local variable compute kind is what will be updated, the value kind must match the local + // Since the local variable compute kind is what will be updated, the runtime kind must match the local // variable's type. That is why before aggregating the compute kind of the assigned value we need to get - // a default value kind of the matching type. - // In some cases, there might be some loss of granularity on the value kind (e.g. assigning an array to + // a default runtime kind of the matching type. + // In some cases, there might be some loss of granularity on the runtime kind (e.g. assigning an array to // 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. if !application_instance.active_dynamic_scopes.is_empty() { let local_type = &assignee_expr.ty; - let mut dynamic_value_kind = ValueKind::new_dynamic_from_type(local_type); + let mut dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(local_type); let mut dynamic_runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - dynamic_value_kind, + dynamic_runtime_kind, local_type, ); update_features_for_type( local_type, &mut dynamic_runtime_features, - &mut dynamic_value_kind, + &mut dynamic_runtime_kind, ); let dynamic_compute_kind = ComputeKind::new_with_runtime_features( dynamic_runtime_features, - dynamic_value_kind, + dynamic_runtime_kind, ); updated_compute_kind = updated_compute_kind.aggregate(dynamic_compute_kind); } // If the updated compute kind is dynamic, include additional properties depending on the type of the // local variable. - if let Some(value_kind) = updated_compute_kind.value_kind() { + if let Some(value_kind) = updated_compute_kind.runtime_kind() { let ComputeKind::Quantum(updated_quantum_properties) = &mut updated_compute_kind else { @@ -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, + RuntimeKind::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, + RuntimeKind::Static, ); } updated_compute_kind @@ -1736,20 +1675,20 @@ impl<'a> Analyzer<'a> { fn update_features_for_type( local_type: &Ty, dynamic_runtime_features: &mut RuntimeFeatureFlags, - dynamic_value_kind: &mut ValueKind, + dynamic_runtime_kind: &mut RuntimeKind, ) { match local_type { Ty::Array(..) => { // For arrays updated in a dynamic context, we also need to include the runtime feature - // of dynamic arrays and change the value kind. + // of dynamic arrays and change the runtime kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; - *dynamic_value_kind = ValueKind::Array(RuntimeKind::Dynamic, RuntimeKind::Dynamic); + *dynamic_runtime_kind = RuntimeKind::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. + // of dynamic tuples and change the runtime kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicTuple; - *dynamic_value_kind = ValueKind::Element(RuntimeKind::Dynamic); + *dynamic_runtime_kind = RuntimeKind::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. @@ -1796,10 +1734,10 @@ impl<'a> Visitor<'a> for Analyzer<'a> { 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); + .aggregate_runtime_features(stmt_compute_kind, RuntimeKind::Static); } - // Update the block's value kind if its non-unit, based on the value kind of its last statement's expression. + // Update the block's runtime kind if its non-unit, based on the runtime kind of its last statement's expression. if block.ty != Ty::UNIT { let last_stmt_id = block .stmts @@ -1811,11 +1749,11 @@ 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 = RuntimeKind::Static; last_expr_quantum_properties - .value_kind + .runtime_kind .project_onto_variant(&mut block_value_kind); - block_compute_kind.aggregate_value_kind(block_value_kind); + block_compute_kind.aggregate_runtime_kind(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); @@ -1965,15 +1902,15 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // If the expression's compute kind is of the quantum variant, then we need to do a couple more things to get // the final compute kind for the expression. if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { - // Since the value kind does not handle all type structures (e.g. it does not handle the structure of 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. + // Since the runtime kind does not handle all type structures (e.g. it does not handle the structure of a + // tuple type), there could be a mismatch between the expected runtime kind variant for the expression's type + // and the runtime kind that we got. // We fix this mismatch here. - let mut value_kind = ValueKind::new_static_from_type(&expr.ty); + let mut runtime_kind = RuntimeKind::Static; quantum_properties - .value_kind - .project_onto_variant(&mut value_kind); - quantum_properties.value_kind = value_kind; + .runtime_kind + .project_onto_variant(&mut runtime_kind); + quantum_properties.runtime_kind = runtime_kind; } // Finally, insert the expression's compute kind in the application instance. @@ -2052,13 +1989,11 @@ impl<'a> Visitor<'a> for Analyzer<'a> { self.visit_expr(*expr_id); // Use the expression compute kind to construct the statement compute kind, using only the expression - // runtime features since the value kind is meaningless for semicolon statements. + // runtime features since the runtime 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, RuntimeKind::Static) } StmtKind::Local(mutability, pat_id, value_expr_id) => { // Visit the expression to determine its compute kind. @@ -2068,13 +2003,11 @@ impl<'a> Visitor<'a> for Analyzer<'a> { self.bind_expr_compute_kind_to_pattern(*mutability, *pat_id, *value_expr_id); // Use the expression compute kind to construct the statement compute kind, using only the expression - // runtime features since the value kind is meaningless for local (binding) statements. + // runtime features since the runtime 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, RuntimeKind::Static) } StmtKind::Item(_) => { // An item statement does not have any inherent quantum properties, so we just treat it as classical compute. @@ -2261,19 +2194,19 @@ fn derive_intrinsic_function_application_generator_set( // When a parameter is bound to a dynamic value, its type contributes to the runtime features used by the // function application. let runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - ValueKind::new_dynamic_from_type(¶m.ty), + RuntimeKind::new_dynamic_from_type(¶m.ty), ¶m.ty, ); - let value_kind = ValueKind::new_dynamic_from_type(&callable_context.output_type); + let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_context.output_type); let param_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }); // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => { - array_param_application_from_runtime_features(runtime_features, value_kind) + array_param_application_from_runtime_features(runtime_features, runtime_kind) } _ => ParamApplication::Element(param_compute_kind), }; @@ -2289,20 +2222,16 @@ fn derive_intrinsic_function_application_generator_set( fn array_param_application_from_runtime_features( runtime_features: RuntimeFeatureFlags, - value_kind: ValueKind, + runtime_kind: RuntimeKind, ) -> 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, + runtime_kind, }), - dynamic_content_dynamic_size: ComputeKind::Quantum(QuantumProperties { + dynamic_size: ComputeKind::Quantum(QuantumProperties { runtime_features: runtime_features | RuntimeFeatureFlags::UseOfDynamicallySizedArray, - value_kind, + runtime_kind, }), }) } @@ -2312,13 +2241,13 @@ fn derive_instrinsic_operation_application_generator_set( ) -> ApplicationGeneratorSet { 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 + // The runtime kind of intrinsic operations is inherently dynamic if their output is not `Unit` or `Qubit`. + let runtime_kind = if callable_context.output_type == Ty::UNIT || callable_context.output_type == Ty::Prim(Prim::Qubit) { - ValueKind::Element(RuntimeKind::Static) + RuntimeKind::Static } else { - ValueKind::new_dynamic_from_type(&callable_context.output_type) + RuntimeKind::new_dynamic_from_type(&callable_context.output_type) }; let mut inherent_runtime_features = RuntimeFeatureFlags::empty(); @@ -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, + runtime_kind, }); // Determine the compute kind of all dynamic parameter applications. @@ -2344,19 +2273,19 @@ fn derive_instrinsic_operation_application_generator_set( // When a parameter is bound to a dynamic value, its type contributes to the runtime features used by the // operation application. let runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - ValueKind::new_dynamic_from_type(¶m.ty), + RuntimeKind::new_dynamic_from_type(¶m.ty), ¶m.ty, ); - let value_kind = ValueKind::new_dynamic_from_type(&callable_context.output_type); + let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_context.output_type); let param_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }); // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => { - array_param_application_from_runtime_features(runtime_features, value_kind) + array_param_application_from_runtime_features(runtime_features, runtime_kind) } _ => ParamApplication::Element(param_compute_kind), }; @@ -2412,29 +2341,21 @@ fn ty_prim_to_runtime_output_flag(prim: Prim) -> RuntimeFeatureFlags { #[allow(clippy::too_many_lines)] fn derive_runtime_features_for_value_kind_associated_to_type( - value_kind: ValueKind, + runtime_kind: RuntimeKind, ty: &Ty, ) -> RuntimeFeatureFlags { fn derive_runtime_features_for_value_kind_associated_to_array( - value_kind: ValueKind, + runtime_kind: RuntimeKind, 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) { - let content_value_kind = ValueKind::new_dynamic_from_type(content_type); + if runtime_kind == RuntimeKind::Dynamic { + // runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; + let content_runtime_kind = RuntimeKind::new_dynamic_from_type(content_type); runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( - content_value_kind, + content_runtime_kind, content_type, ); } @@ -2443,14 +2364,10 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_arrow( - value_kind: ValueKind, + runtime_kind: RuntimeKind, 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 runtime_kind == RuntimeKind::Static { return RuntimeFeatureFlags::empty(); } @@ -2461,15 +2378,11 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_primitive_type( - value_kind: ValueKind, + runtime_kind: RuntimeKind, prim: Prim, ) -> RuntimeFeatureFlags { - match value_kind { - ValueKind::Array(RuntimeKind::Static, RuntimeKind::Static) - | ValueKind::Element(RuntimeKind::Static) => { - return RuntimeFeatureFlags::empty(); - } - _ => (), + if runtime_kind == RuntimeKind::Static { + return RuntimeFeatureFlags::empty(); } match prim { @@ -2489,22 +2402,18 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_primitive_tuple( - value_kind: ValueKind, + runtime_kind: RuntimeKind, 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 runtime_kind == RuntimeKind::Static { return RuntimeFeatureFlags::empty(); } let mut runtime_features = RuntimeFeatureFlags::empty(); for element_type in element_types { - let element_value_kind = ValueKind::new_dynamic_from_type(element_type); + let element_runtime_kind = RuntimeKind::new_dynamic_from_type(element_type); runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( - element_value_kind, + element_runtime_kind, element_type, ); } @@ -2512,12 +2421,8 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_udt( - value_kind: ValueKind, + runtime_kind: RuntimeKind, ) -> 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(), @@ -2526,24 +2431,24 @@ fn derive_runtime_features_for_value_kind_associated_to_type( match ty { Ty::Array(content_type) => { - derive_runtime_features_for_value_kind_associated_to_array(value_kind, content_type) + derive_runtime_features_for_value_kind_associated_to_array(runtime_kind, content_type) } Ty::Arrow(arrow) => { - derive_runtime_features_for_value_kind_associated_to_arrow(value_kind, arrow) + derive_runtime_features_for_value_kind_associated_to_arrow(runtime_kind, arrow) } Ty::Infer(_) => panic!("cannot derive runtime features for `Infer` type"), // Generic types do not require additional runtime features. Ty::Param(_) => RuntimeFeatureFlags::empty(), Ty::Prim(prim) => { - derive_runtime_features_for_value_kind_associated_to_primitive_type(value_kind, *prim) + derive_runtime_features_for_value_kind_associated_to_primitive_type(runtime_kind, *prim) } Ty::Tuple(element_types) => { derive_runtime_features_for_value_kind_associated_to_primitive_tuple( - value_kind, + runtime_kind, element_types, ) } - Ty::Udt(_) => derive_runtime_features_for_value_kind_associated_to_udt(value_kind), + Ty::Udt(_) => derive_runtime_features_for_value_kind_associated_to_udt(runtime_kind), Ty::Err => panic!("cannot derive runtime features for `Err` type"), } } diff --git a/source/compiler/qsc_rca/src/cyclic_callables.rs b/source/compiler/qsc_rca/src/cyclic_callables.rs index 3bf251fb1b..d44c46388a 100644 --- a/source/compiler/qsc_rca/src/cyclic_callables.rs +++ b/source/compiler/qsc_rca/src/cyclic_callables.rs @@ -3,7 +3,7 @@ use crate::{ ApplicationGeneratorSet, ArrayParamApplication, ComputeKind, ParamApplication, - RuntimeFeatureFlags, ValueKind, common::LocalSpecId, cycle_detection::CycleDetector, + RuntimeFeatureFlags, RuntimeKind, common::LocalSpecId, cycle_detection::CycleDetector, scaffolding::InternalPackageStoreComputeProperties, }; use qsc_fir::{ @@ -143,21 +143,20 @@ impl<'a> Analyzer<'a> { Vec::::with_capacity(input_params.len()); for param in input_params { // If any parameter is dynamic, we assume the output of a function with cycles is also dynamic. - let value_kind = ValueKind::new_dynamic_from_type(output_type); + let runtime_kind = RuntimeKind::new_dynamic_from_type(output_type); // Since using cyclic functions with dynamic parameters requires advanced runtime capabilities, we use the // corresponding runtime feature. let param_compute_kind = ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::CallToCyclicFunctionWithDynamicArg, - value_kind, + runtime_kind, ); // 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), }; @@ -277,10 +276,10 @@ fn create_operation_specialization_application_generator_set( ) -> ApplicationGeneratorSet { // Since operations can allocate and measure qubits freely, we assume its compute kind is quantum and that their // value kind is dynamic. - let value_kind = ValueKind::new_dynamic_from_type(output_type); + let runtime_kind = RuntimeKind::new_dynamic_from_type(output_type); let inherent_compute_kind = ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::CyclicOperationSpec, - value_kind, + runtime_kind, ); // The compute kind of a cyclic operation for all dynamic parameter applications is the same as its inherent @@ -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..b8d769a9f1 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.runtime_kind { + RuntimeKind::Dynamic + if quantum_properties + .runtime_features + .contains(RuntimeFeatureFlags::UseOfDynamicallySizedArray) => + { + compute_kind = + compute_kind.aggregate(array_param_application.dynamic_size); + } + RuntimeKind::Dynamic => { + compute_kind = + compute_kind.aggregate(array_param_application.static_size); + } + RuntimeKind::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,30 +443,14 @@ 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, + runtime_kind: RuntimeKind, ) -> Self { Self::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }) } @@ -516,24 +469,24 @@ impl ComputeKind { }; // Determine the aggregated value kind. - let value_kind = match self { - Self::Classical => value_quantum_properties.value_kind, + let runtime_kind = match self { + Self::Classical => value_quantum_properties.runtime_kind, Self::Quantum(self_quantum_properties) => self_quantum_properties - .value_kind - .aggregate(value_quantum_properties.value_kind), + .runtime_kind + .aggregate(value_quantum_properties.runtime_kind), }; // Return the aggregated compute kind. ComputeKind::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }) } pub(crate) fn aggregate_runtime_features( self, value: ComputeKind, - default_value_kind: ValueKind, + default_runtime_kind: RuntimeKind, ) -> Self { let Self::Quantum(value_quantum_properties) = value else { // A classical compute kind has nothing to aggregate so just return the self with no changes. @@ -548,46 +501,41 @@ impl ComputeKind { } }; - // Use the value kind equivalent from self. - let value_kind = match self { - // If self was classical, the aggregated value kind is all static. - Self::Classical => default_value_kind, - Self::Quantum(self_quantum_properties) => self_quantum_properties.value_kind, + // Use the runtime kind equivalent from self. + let runtime_kind = match self { + // If self was classical, the aggregated runtime kind is all static. + Self::Classical => default_runtime_kind, + Self::Quantum(self_quantum_properties) => self_quantum_properties.runtime_kind, }; // Return the aggregated compute kind. ComputeKind::Quantum(QuantumProperties { runtime_features, - value_kind, + runtime_kind, }) } - pub(crate) fn aggregate_value_kind(&mut self, value: ValueKind) { + pub(crate) fn aggregate_runtime_kind(&mut self, value: RuntimeKind) { let Self::Quantum(quantum_properties) = self else { panic!("a value kind can only be aggregated to a compute kind of the quantum variant"); }; - quantum_properties.value_kind = quantum_properties.value_kind.aggregate(value); + quantum_properties.runtime_kind = quantum_properties.runtime_kind.aggregate(value); } pub(crate) 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.runtime_kind == RuntimeKind::Dynamic + } } } - pub(crate) fn value_kind(self) -> Option { + pub(crate) fn runtime_kind(self) -> Option { match self { Self::Classical => None, - 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, + Self::Quantum(quantum_properties) => Some(quantum_properties.runtime_kind), } } } @@ -598,7 +546,7 @@ pub struct QuantumProperties { /// The runtime features used by the program element. pub runtime_features: RuntimeFeatureFlags, /// The kind of value of the program element. - pub value_kind: ValueKind, + pub runtime_kind: RuntimeKind, } impl Display for QuantumProperties { @@ -607,120 +555,12 @@ impl Display for QuantumProperties { write!(indent, "QuantumProperties:",)?; indent = set_indentation(indent, 1); write!(indent, "\nruntime_features: {:?}", self.runtime_features)?; - write!(indent, "\nvalue_kind: {}", self.value_kind)?; - Ok(()) - } -} - -#[derive(Clone, Copy, Debug)] -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), -} - -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})")?, - } + write!(indent, "\nruntime_kind: {}", self.runtime_kind)?; 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)) - } - } - } - - #[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 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)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RuntimeKind { Static, Dynamic, @@ -747,6 +587,26 @@ impl RuntimeKind { Self::Dynamic => Self::Dynamic, } } + + pub(crate) fn new_dynamic_from_type(ty: &Ty) -> Self { + if *ty == Ty::UNIT { + // The associated runtime kind for a unit type is always static. + Self::Static + } else { + Self::Dynamic + } + } + + pub(crate) fn project_onto_variant(self, variant: &mut RuntimeKind) { + match self { + RuntimeKind::Static => { + // No changes needed. + } + RuntimeKind::Dynamic => { + *variant = RuntimeKind::Dynamic; + } + } + } } bitflags! { diff --git a/source/compiler/qsc_rca/src/overrider.rs b/source/compiler/qsc_rca/src/overrider.rs index 8ee895451a..f4f87d17ac 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, RuntimeKind, 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), + runtime_kind: RuntimeKind::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..037b130b55 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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..3b7c52bd26 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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..874c045c11 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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..165f91b3d0 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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) + runtime_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) + runtime_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) + runtime_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..7965aedc8c 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) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | UseOfDynamicallySizedArray | LoopWithDynamicCondition) - value_kind: Array(Content: Dynamic, Size: Dynamic) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static)"# - ], + runtime_kind: Static"#]], ); } diff --git a/source/compiler/qsc_rca/src/tests/calls.rs b/source/compiler/qsc_rca/src/tests/calls.rs index 44eb31e870..c4338f9686 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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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..a6b400d3c5 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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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: + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Dynamic) + runtime_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) + runtime_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: + runtime_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) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - value_kind: Element(Static) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [3]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicQubit | CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - value_kind: Element(Static) + runtime_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..91b798494f 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) + runtime_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: "# - ], + runtime_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..da2567109b 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) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + runtime_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) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + runtime_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) + runtime_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) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Dynamic) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - value_kind: Element(Static) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - value_kind: Element(Dynamic) + runtime_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) + runtime_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Dynamic) + runtime_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) + runtime_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: + runtime_kind: Static + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - value_kind: Element(Static) + runtime_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Static) + runtime_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: + runtime_kind: Static + dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit | UseOfDynamicallySizedArray) - value_kind: Element(Static) + runtime_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) + runtime_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - value_kind: Element(Static) + runtime_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) + runtime_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..35a63448a7 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) + runtime_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) + runtime_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) + runtime_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) + runtime_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..4fbdefc50d 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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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) + runtime_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..cd73696061 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: "# - ], + runtime_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) + runtime_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: "# - ], + runtime_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) + runtime_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: "# - ], + runtime_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..719a18c2a8 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) + runtime_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) + runtime_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..066138f3e3 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: "# - ], + runtime_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) + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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..1453fee72f 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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..ea9b3f32f2 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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..0d03f8f8b6 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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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: "# - ], + runtime_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..2ccb4ce7f8 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: "# - ], + runtime_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: "# - ], + runtime_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..9dff71e4bf 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: "# - ], + runtime_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: "# - ], + runtime_kind: Dynamic + dynamic_param_applications: "#]], ); } From bb3c7bbde7ab151ce3618181f285d52b9e09ee60 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Fri, 9 Jan 2026 12:23:24 -0800 Subject: [PATCH 2/2] Rename, clean-up --- .../src/evaluation_context.rs | 26 +- source/compiler/qsc_partial_eval/src/lib.rs | 15 +- source/compiler/qsc_rca/src/applications.rs | 96 ++- source/compiler/qsc_rca/src/core.rs | 352 ++++++----- .../compiler/qsc_rca/src/cyclic_callables.rs | 10 +- source/compiler/qsc_rca/src/lib.rs | 77 +-- source/compiler/qsc_rca/src/overrider.rs | 4 +- source/compiler/qsc_rca/src/tests/arrays.rs | 40 +- source/compiler/qsc_rca/src/tests/assigns.rs | 34 +- source/compiler/qsc_rca/src/tests/bindings.rs | 8 +- source/compiler/qsc_rca/src/tests/binops.rs | 14 +- .../compiler/qsc_rca/src/tests/callables.rs | 586 +++++++++--------- source/compiler/qsc_rca/src/tests/calls.rs | 24 +- source/compiler/qsc_rca/src/tests/cycles.rs | 114 ++-- source/compiler/qsc_rca/src/tests/ifs.rs | 4 +- .../compiler/qsc_rca/src/tests/intrinsics.rs | 206 +++--- source/compiler/qsc_rca/src/tests/lambdas.rs | 8 +- source/compiler/qsc_rca/src/tests/loops.rs | 20 +- .../qsc_rca/src/tests/measurements.rs | 10 +- .../compiler/qsc_rca/src/tests/overrides.rs | 4 +- source/compiler/qsc_rca/src/tests/qubits.rs | 8 +- source/compiler/qsc_rca/src/tests/strings.rs | 10 +- source/compiler/qsc_rca/src/tests/structs.rs | 6 +- source/compiler/qsc_rca/src/tests/types.rs | 14 +- source/compiler/qsc_rca/src/tests/udts.rs | 4 +- source/compiler/qsc_rca/src/tests/vars.rs | 4 +- 26 files changed, 836 insertions(+), 862 deletions(-) diff --git a/source/compiler/qsc_partial_eval/src/evaluation_context.rs b/source/compiler/qsc_partial_eval/src/evaluation_context.rs index f3a56fdb41..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::{ComputeKind, RuntimeFeatureFlags, RuntimeKind}; +use qsc_rca::{ComputeKind, RuntimeFeatureFlags, ValueKind}; use qsc_rir::rir::{BlockId, Literal, VariableId}; use rustc_hash::FxHashMap; use std::collections::hash_map::Entry; @@ -137,7 +137,7 @@ impl Scope { }; ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::empty(), - map_eval_value_to_runtime_kind(value), + map_eval_value_to_value_kind(value), ) }) .collect(); @@ -288,28 +288,28 @@ impl EvalControlFlow { } } -fn map_eval_value_to_runtime_kind(value: &Value) -> RuntimeKind { +fn map_eval_value_to_value_kind(value: &Value) -> ValueKind { match value { Value::Array(elements) => { for element in elements.iter() { - let element_runtime_kind = map_eval_value_to_runtime_kind(element); - if element_runtime_kind == RuntimeKind::Dynamic { - return RuntimeKind::Dynamic; + let element_runtime_kind = map_eval_value_to_value_kind(element); + if element_runtime_kind == ValueKind::Dynamic { + return ValueKind::Dynamic; } } - RuntimeKind::Static + ValueKind::Static } Value::Tuple(elements, _) => { for element in elements.iter() { - let element_runtime_kind = map_eval_value_to_runtime_kind(element); - if element_runtime_kind == RuntimeKind::Dynamic { - return RuntimeKind::Dynamic; + let element_runtime_kind = map_eval_value_to_value_kind(element); + if element_runtime_kind == ValueKind::Dynamic { + return ValueKind::Dynamic; } } - RuntimeKind::Static + ValueKind::Static } - Value::Result(Result::Id(_) | Result::Loss) | Value::Var(_) => RuntimeKind::Dynamic, + Value::Result(Result::Id(_) | Result::Loss) | Value::Var(_) => ValueKind::Dynamic, Value::BigInt(_) | Value::Bool(_) | Value::Closure(_) @@ -320,6 +320,6 @@ fn map_eval_value_to_runtime_kind(value: &Value) -> RuntimeKind { | Value::Qubit(_) | Value::Range(_) | Value::Result(Result::Val(_)) - | Value::String(_) => 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 0be09e171d..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, + QuantumProperties, RuntimeFeatureFlags, ValueKind, errors::{ Error as CapabilityError, generate_errors_from_runtime_features, get_missing_runtime_features, @@ -1505,7 +1505,7 @@ impl<'a> PartialEvaluator<'a> { let call_compute_kind = self.get_call_compute_kind(call_scope); if let ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }) = call_compute_kind { let missing_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 runtime_kind == RuntimeKind::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: _, - runtime_kind: RuntimeKind::Static, - }) - ), + !self.get_expr_compute_kind(condition_expr_id).is_dynamic(), "loop conditions must be purely classical" ); diff --git a/source/compiler/qsc_rca/src/applications.rs b/source/compiler/qsc_rca/src/applications.rs index 062320064d..8d38c6052b 100644 --- a/source/compiler/qsc_rca/src/applications.rs +++ b/source/compiler/qsc_rca/src/applications.rs @@ -2,7 +2,7 @@ // Licensed under the MIT License. use crate::{ - ApplicationGeneratorSet, ComputeKind, QuantumProperties, RuntimeFeatureFlags, RuntimeKind, + ApplicationGeneratorSet, ComputeKind, QuantumProperties, RuntimeFeatureFlags, ValueKind, common::{Local, LocalKind, LocalsLookup, initialize_locals_map}, scaffolding::InternalPackageComputeProperties, }; @@ -47,22 +47,9 @@ 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, - ComputeKind::new_with_runtime_features( - RuntimeFeatureFlags::UseOfDynamicallySizedArray, - RuntimeKind::Dynamic, - ), - )), - ); let dynamic_content_static_size = ApplicationInstance::new( input_params, controls, @@ -71,7 +58,7 @@ impl GeneratorSetsBuilder { input_param.index, ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::empty(), - RuntimeKind::Dynamic, + ValueKind::Dynamic, ), )), ); @@ -83,15 +70,11 @@ impl GeneratorSetsBuilder { input_param.index, ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicallySizedArray, - RuntimeKind::Dynamic, + 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. @@ -103,7 +86,7 @@ impl GeneratorSetsBuilder { input_param.index, ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::empty(), - RuntimeKind::Dynamic, + ValueKind::Dynamic, ), )), )] @@ -182,15 +165,14 @@ impl GeneratorSetsBuilder { == dynamic_param_applications_compute_properties.len() ); - // Update the runtime kind of the generator's inherent compute kind. - if let Some(inherent_value_kind) = inherent_application_compute_properties.runtime_kind - { + // Update the value kind of the generator's inherent compute kind. + if let Some(inherent_value_kind) = inherent_application_compute_properties.value_kind { applications_generator .inherent - .aggregate_runtime_kind(inherent_value_kind); + .aggregate_value_kind(inherent_value_kind); } - // Update the runtime kind of the generator's param applications. + // Update the value kind of the generator's param applications. for (param_application, compute_properties) in applications_generator .dynamic_param_applications .iter_mut() @@ -220,21 +202,21 @@ impl GeneratorSetsBuilder { }; array_compute_properties .static_size - .runtime_kind + .value_kind .iter() - .for_each(|runtime_kind| { + .for_each(|value_kind| { array_param_application .static_size - .aggregate_runtime_kind(*runtime_kind); + .aggregate_value_kind(*value_kind); }); array_compute_properties .dynamic_size - .runtime_kind + .value_kind .iter() - .for_each(|runtime_kind| { + .for_each(|value_kind| { array_param_application .dynamic_size - .aggregate_runtime_kind(*runtime_kind); + .aggregate_value_kind(*value_kind); }); } crate::ParamApplication::Element(element_param_application) => { @@ -244,10 +226,10 @@ impl GeneratorSetsBuilder { panic!("expected an element param application"); }; element_compute_properties - .runtime_kind + .value_kind .iter() .for_each(|value_kind| { - element_param_application.aggregate_runtime_kind(*value_kind); + element_param_application.aggregate_value_kind(*value_kind); }); } } @@ -264,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. @@ -472,7 +454,7 @@ impl ApplicationInstance { // no runtime features here. let compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::empty(), - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, }); locals_map.insert( controls.var, @@ -518,23 +500,23 @@ impl ApplicationInstance { } fn close(self) -> ApplicationInstanceComputeProperties { - // Determine the runtime kind of the application instance by going through each return expression aggregating - // their runtime kind (if any). - let mut runtime_kinds = Vec::new(); + // 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(); 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); - // There are two scenarios in which a runtime kind is considered, and both of them only happen if the return + // There are two scenarios in which a value kind is considered, and both of them only happen if the return // expression is quantum. if let ComputeKind::Quantum(return_quantum_properties) = return_expr_compute_kind { let return_value_kind = if return_quantum_properties .runtime_features .contains(RuntimeFeatureFlags::ReturnWithinDynamicScope) { - // The return expression happens within a dynamic scope so the runtime kind is dynamic. - RuntimeKind::new_dynamic_from_type(&self.return_type) + // The return expression happens within a dynamic scope so the value kind is dynamic. + ValueKind::new_dynamic_from_type(&self.return_type) } else { - // What we actually want here is the runtime kind of the returned value expression. + // What we actually want here is the value kind of the returned value expression. let returned_value_expr_compute_kind = self.get_expr_compute_kind(returned_value_expr_id); let ComputeKind::Quantum(returned_value_quantum_properties) = @@ -542,25 +524,25 @@ impl ApplicationInstance { else { panic!("returned value expression is expected to be quantum"); }; - returned_value_quantum_properties.runtime_kind + returned_value_quantum_properties.value_kind }; - runtime_kinds.push(return_value_kind); + value_kinds.push(return_value_kind); } } - // An application instance does not always have a runtime kind, only when there is at least one quantum return + // An application instance does not always have a value kind, only when there is at least one quantum return // expression. - let runtime_kind = if runtime_kinds.is_empty() { + let value_kind = if value_kinds.is_empty() { None } else { - let initial_runtime_kind = RuntimeKind::Static; - let runtime_kind = runtime_kinds.iter().fold( - initial_runtime_kind, - |aggregated_runtime_kind, return_runtime_kind| { - aggregated_runtime_kind.aggregate(*return_runtime_kind) + let initial_value_kind = ValueKind::Static; + let value_kind = value_kinds.iter().fold( + initial_value_kind, + |aggregated_value_kind, return_value_kind| { + aggregated_value_kind.aggregate(*return_value_kind) }, ); - Some(runtime_kind) + Some(value_kind) }; ApplicationInstanceComputeProperties { @@ -568,7 +550,7 @@ impl ApplicationInstance { stmts: self.stmts, exprs: self.exprs, unresolved_callee_exprs: self.unresolved_callee_exprs, - runtime_kind, + value_kind, } } } @@ -642,7 +624,7 @@ struct ApplicationInstanceComputeProperties { blocks: FxHashMap, stmts: FxHashMap, exprs: FxHashMap, - runtime_kind: Option, + value_kind: Option, unresolved_callee_exprs: Vec, } diff --git a/source/compiler/qsc_rca/src/core.rs b/source/compiler/qsc_rca/src/core.rs index 2070ffc15d..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, + 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_runtime_kind = 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 { @@ -70,7 +70,7 @@ 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_runtime_kind); + compute_kind.aggregate_runtime_features(*expr_compute_kind, default_value_kind); has_dynamic_content |= expr_compute_kind.is_dynamic(); } @@ -81,7 +81,7 @@ impl<'a> Analyzer<'a> { ); }; - quantum_properties.runtime_kind = RuntimeKind::Dynamic; + quantum_properties.value_kind = ValueKind::Dynamic; } compute_kind @@ -101,12 +101,12 @@ impl<'a> Analyzer<'a> { 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_runtime_kind = 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_runtime_kind); + compute_kind.aggregate_runtime_features(size_expr_compute_kind, default_value_kind); compute_kind = - compute_kind.aggregate_runtime_features(value_expr_compute_kind, default_runtime_kind); + compute_kind.aggregate_runtime_features(value_expr_compute_kind, default_value_kind); if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { // If the array is dynamic, it requires an additional runtime feature. @@ -115,11 +115,11 @@ impl<'a> Analyzer<'a> { RuntimeFeatureFlags::UseOfDynamicallySizedArray; } - quantum_properties.runtime_kind = + quantum_properties.value_kind = if value_expr_compute_kind.is_dynamic() || size_expr_compute_kind.is_dynamic() { - RuntimeKind::Dynamic + ValueKind::Dynamic } else { - RuntimeKind::Static + ValueKind::Static }; } @@ -139,15 +139,15 @@ impl<'a> Analyzer<'a> { // the value expression. let updated_compute_kind = self.update_locals_compute_kind(assignee_expr_id, value_expr_id); - // We do not care about the runtime kind for this kind of expression because it is an assignment, but we still + // 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_runtime_kind = 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 // associated to the local variable. compute_kind = - compute_kind.aggregate_runtime_features(updated_compute_kind, default_runtime_kind); + compute_kind.aggregate_runtime_features(updated_compute_kind, default_value_kind); compute_kind } @@ -168,23 +168,23 @@ impl<'a> Analyzer<'a> { let mut replacement_value_compute_kind = *application_instance.get_expr_compute_kind(replacement_value_expr_id); - let mut default_runtime_kind = 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_runtime_kind = RuntimeKind::Dynamic; + default_value_kind = ValueKind::Dynamic; replacement_value_compute_kind = replacement_value_compute_kind.aggregate(ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicallySizedArray, - RuntimeKind::Static, + ValueKind::Static, )); } let mut updated_compute_kind = ComputeKind::Classical; updated_compute_kind = updated_compute_kind - .aggregate_runtime_features(replacement_value_compute_kind, default_runtime_kind); + .aggregate_runtime_features(replacement_value_compute_kind, default_value_kind); - // If the replacement value expression is dynamic, the runtime features and runtime kind of the update have to + // If the replacement value expression is dynamic, the runtime features and value kind of the update have to // take this into account. if replacement_value_compute_kind.is_dynamic() { let ComputeKind::Quantum(quantum_properties) = &mut updated_compute_kind else { @@ -193,7 +193,7 @@ impl<'a> Analyzer<'a> { ); }; - quantum_properties.runtime_kind = RuntimeKind::Dynamic; + quantum_properties.value_kind = ValueKind::Dynamic; } // Update the compute kind of the local variable in the locals map. @@ -208,24 +208,24 @@ impl<'a> Analyzer<'a> { // The compute kind of this expression is determined by aggregating the runtime features of the index and // replacement expressions. - // We do not care about the runtime kind for this kind of expression because it is an assignment, but we still + // 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_runtime_kind = 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 = - compute_kind.aggregate_runtime_features(index_compute_kind, default_runtime_kind); + compute_kind.aggregate_runtime_features(index_compute_kind, default_value_kind); compute_kind = compute_kind - .aggregate_runtime_features(replacement_value_compute_kind, default_runtime_kind); + .aggregate_runtime_features(replacement_value_compute_kind, default_value_kind); // Finally, if the index expression is dynamic, we aggregate an additional runtime feature. if index_compute_kind.is_dynamic() { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicIndex, - default_runtime_kind, + default_value_kind, ), - default_runtime_kind, + default_value_kind, ); } compute_kind @@ -251,7 +251,7 @@ impl<'a> Analyzer<'a> { // Additionally, since the new compute kind can be of a different type than its operands (e.g. 1 == 1), // aggregate additional runtime features depending on the binary operator expression's type (if it's dynamic). - if let Some(value_kind) = compute_kind.runtime_kind() { + if let Some(value_kind) = compute_kind.value_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of compute kind"); }; @@ -283,9 +283,9 @@ impl<'a> Analyzer<'a> { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicExponent, - RuntimeKind::Static, + ValueKind::Static, ), - RuntimeKind::Static, + ValueKind::Static, ); } @@ -315,12 +315,12 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let callee_expr_compute_kind = *application_instance.get_expr_compute_kind(callee_expr_id); let mut compute_kind = if callee_expr_compute_kind.is_dynamic() { - // The runtime kind of a call expression with an dynamic callee is dynamic but its specific variant depends + // The value kind of a call expression with an dynamic callee is dynamic but its specific variant depends // on the expression's type. - let runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); + let value_kind = ValueKind::new_dynamic_from_type(expr_type); ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToDynamicCallee, - runtime_kind, + value_kind, }) } else { let call_compute_kind = @@ -338,10 +338,10 @@ impl<'a> Analyzer<'a> { 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. if let Ty::Prim(Prim::Qubit) = expr_type { - // We consider this qubit dynamic so the runtime kind of this expression must be dynamic. + // 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(), - runtime_kind: RuntimeKind::Dynamic, + value_kind: ValueKind::Dynamic, })); } @@ -349,15 +349,15 @@ impl<'a> Analyzer<'a> { compute_kind = compute_kind.aggregate_runtime_features( ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::MeasurementWithinDynamicScope, - RuntimeKind::Static, + ValueKind::Static, ), - RuntimeKind::Static, + ValueKind::Static, ); } } // If the call expression is dynamic, aggregate the corresponding runtime features depending on its type. - if let Some(value_kind) = compute_kind.runtime_kind() { + if let Some(value_kind) = compute_kind.value_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of Compute Kind"); }; @@ -369,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, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(callee_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(args_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(args_expr_compute_kind, ValueKind::Static); compute_kind } @@ -387,7 +387,7 @@ impl<'a> Analyzer<'a> { { ComputeKind::new_with_runtime_features( quantum_properties.runtime_features, - RuntimeKind::Dynamic, + ValueKind::Dynamic, ) } else { ComputeKind::Classical @@ -435,7 +435,7 @@ impl<'a> Analyzer<'a> { ); let application_instance = self.get_current_application_instance(); - // Derive the compute kind based on the runtime kind of the arguments. + // Derive the compute kind based on the value kind of the arguments. 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 @@ -458,20 +458,20 @@ impl<'a> Analyzer<'a> { // Aggregate the runtime features of the qubit controls expressions. let mut has_dynamic_controls = false; - let default_runtime_kind = RuntimeKind::Static; + 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); compute_kind = compute_kind - .aggregate_runtime_features(control_expr_compute_kind, default_runtime_kind); + .aggregate_runtime_features(control_expr_compute_kind, default_value_kind); has_dynamic_controls |= control_expr_compute_kind.is_dynamic(); } // If any of the control expressions is dynamic, set the compute kind of the call expression to the // corresponding dynamic variant. if has_dynamic_controls { - let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_decl.output); - compute_kind.aggregate_runtime_kind(runtime_kind); + let value_kind = ValueKind::new_dynamic_from_type(&callable_decl.output); + compute_kind.aggregate_value_kind(value_kind); } // To distinguish between a cyclic operation and a call to a cyclic operation, replace the cyclic operation @@ -489,19 +489,19 @@ impl<'a> Analyzer<'a> { .insert(RuntimeFeatureFlags::CallToCyclicOperation); } - // If the callable output has type parameters, there might be a discrepancy in the runtime kind variant we derive - // from the application generator set and the runtime kind variant that corresponds to the call expression type. + // If the callable output has type parameters, there might be a discrepancy in the value kind variant we derive + // from the application generator set and the value kind variant that corresponds to the call expression type. // Fix that discrepancy here. if callable_decl.output.has_type_parameters() && let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { - // Create a default runtime kind for the call expression type just to know which variant we should map to. + // 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_runtime_kind = RuntimeKind::Static; + let mut mapped_runtime_kind = ValueKind::Static; quantum_properties - .runtime_kind + .value_kind .project_onto_variant(&mut mapped_runtime_kind); - quantum_properties.runtime_kind = mapped_runtime_kind; + quantum_properties.value_kind = mapped_runtime_kind; } CallComputeKind::Regular(compute_kind) } @@ -525,12 +525,12 @@ impl<'a> Analyzer<'a> { // If the callee could not be resolved, return a compute kind with certain runtime features. let (Some(callee), fixed_args) = maybe_callee else { - // The runtime kind of a call expression with an unresolved callee is not known, so to avoid + // 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 compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToUnresolvedCallee, - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, }); self.get_current_application_instance_mut() .unresolved_callee_exprs @@ -556,7 +556,7 @@ impl<'a> Analyzer<'a> { .push(callee_expr_id); return CallComputeKind::Regular(ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::CallToUnresolvedCallee, - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, })); } @@ -588,12 +588,12 @@ impl<'a> Analyzer<'a> { // expression. let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(args_expr_compute_kind, RuntimeKind::Static); + 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_runtime_kind(RuntimeKind::Dynamic); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -609,7 +609,7 @@ impl<'a> Analyzer<'a> { let msg_expr_compute_kind = *application_instance.get_expr_compute_kind(msg_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(msg_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(msg_expr_compute_kind, ValueKind::Static); compute_kind } @@ -619,13 +619,13 @@ impl<'a> Analyzer<'a> { self.visit_expr(record_expr_id); // The compute kind of the field expression is determined from the runtime features of the record expression and - // the runtime kind adapted to the expression's type. + // 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 runtime_kind = if record_expr_compute_kind.is_dynamic() { - RuntimeKind::new_dynamic_from_type(expr_type) + ValueKind::new_dynamic_from_type(expr_type) } else { - RuntimeKind::Static + ValueKind::Static }; let mut compute_kind = ComputeKind::Classical; @@ -676,16 +676,16 @@ impl<'a> Analyzer<'a> { 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, RuntimeKind::Static); + 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, RuntimeKind::Static); + 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, RuntimeKind::Static); + .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 @@ -695,15 +695,15 @@ impl<'a> Analyzer<'a> { || otherwise_expr_id .is_some_and(|e| application_instance.get_expr_compute_kind(e).is_dynamic()); if is_any_sub_expr_dynamic { - let dynamic_runtime_kind = if matches!(expr_type, Ty::Array(..)) { + let dynamic_value_kind = if matches!(expr_type, Ty::Array(..)) { // An array coming from a dynamic conditional should be treated as dynamic. - RuntimeKind::Dynamic + ValueKind::Dynamic } else { - RuntimeKind::new_dynamic_from_type(expr_type) + ValueKind::new_dynamic_from_type(expr_type) }; let mut dynamic_runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - dynamic_runtime_kind, + dynamic_value_kind, expr_type, ); if condition_expr_compute_kind.is_dynamic() { @@ -722,7 +722,7 @@ impl<'a> Analyzer<'a> { } let dynamic_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: dynamic_runtime_features, - runtime_kind: dynamic_runtime_kind, + value_kind: dynamic_value_kind, }); compute_kind = compute_kind.aggregate(dynamic_compute_kind); } @@ -747,34 +747,34 @@ impl<'a> Analyzer<'a> { let index_expr_compute_kind = *application_instance.get_expr_compute_kind(index_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(array_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(array_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, ValueKind::Static); - // If the index expression is dynamic, the runtime kind of the expression is also dynamic and an additional + // 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 - && index_quantum_properties.runtime_kind == RuntimeKind::Dynamic + && index_quantum_properties.value_kind == ValueKind::Dynamic { let dynamic_runtime_features = RuntimeFeatureFlags::UseOfDynamicIndex; - let dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); + let dynamic_runtime_kind = ValueKind::new_dynamic_from_type(expr_type); compute_kind = compute_kind.aggregate(ComputeKind::Quantum(QuantumProperties { runtime_features: dynamic_runtime_features, - runtime_kind: dynamic_runtime_kind, + value_kind: dynamic_runtime_kind, })); } - // The runtime kind of the access by index expression also depends on whether the content of the array expression + // 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 - && array_quantum_properties.runtime_kind == RuntimeKind::Dynamic + && array_quantum_properties.value_kind == ValueKind::Dynamic { - let dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(expr_type); - compute_kind.aggregate_runtime_kind(dynamic_runtime_kind); + 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. - if let Some(value_kind) = compute_kind.runtime_kind() { + if let Some(value_kind) = compute_kind.value_kind() { let ComputeKind::Quantum(quantum_properties) = &mut compute_kind else { panic!("expected quantum variant of Compute Kind"); }; @@ -822,7 +822,7 @@ impl<'a> Analyzer<'a> { if compute_kind.is_dynamic() { compute_kind = compute_kind.aggregate(ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::UseOfDynamicRange, - RuntimeKind::Static, + ValueKind::Static, )); } compute_kind @@ -839,14 +839,14 @@ impl<'a> Analyzer<'a> { } else { ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::ReturnWithinDynamicScope, - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, }) }; // Now just aggregate the runtime features of the value expression. 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, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(value_expr_compute_kind, ValueKind::Static); compute_kind } @@ -864,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, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(expr_compute_kind, ValueKind::Static); has_dynamic_sub_exprs |= expr_compute_kind.is_dynamic(); } @@ -874,20 +874,20 @@ 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, RuntimeKind::Static); + 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_runtime_kind(RuntimeKind::Dynamic); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } // If the constructor is dynamic, aggregate the corresponding runtime features depending on its type. if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { quantum_properties.runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( - quantum_properties.runtime_kind, + quantum_properties.value_kind, expr_type, ); } @@ -908,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, RuntimeKind::Static); + .aggregate_runtime_features(component_compute_kind, ValueKind::Static); has_dynamic_components |= component_compute_kind.is_dynamic(); } StringComponent::Lit(_) => { @@ -923,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.runtime_kind = RuntimeKind::Dynamic; + quantum_properties.value_kind = ValueKind::Dynamic; } compute_kind @@ -939,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, RuntimeKind::Static); + 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_runtime_kind(RuntimeKind::Dynamic); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -977,13 +977,13 @@ impl<'a> Analyzer<'a> { *application_instance.get_expr_compute_kind(replace_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(record_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(record_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(replace_expr_compute_kind, RuntimeKind::Static); + 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_runtime_kind(RuntimeKind::Dynamic); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -1009,31 +1009,31 @@ impl<'a> Analyzer<'a> { *application_instance.get_expr_compute_kind(replacement_value_expr_id); let mut compute_kind = ComputeKind::Classical; compute_kind = - compute_kind.aggregate_runtime_features(array_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(array_expr_compute_kind, ValueKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(index_expr_compute_kind, RuntimeKind::Static); + compute_kind.aggregate_runtime_features(index_expr_compute_kind, ValueKind::Static); compute_kind = compute_kind - .aggregate_runtime_features(replacement_value_expr_compute_kind, RuntimeKind::Static); + .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, - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, }); - compute_kind = compute_kind - .aggregate_runtime_features(additional_compute_kind, RuntimeKind::Static); + compute_kind = + compute_kind.aggregate_runtime_features(additional_compute_kind, ValueKind::Static); } - // The runtime kind of the update index expression is based on the runtime kind of the array expression. + // The value kind of the update index expression is based on the value kind of the array expression. if let ComputeKind::Quantum(array_quantum_properties) = array_expr_compute_kind { - compute_kind.aggregate_runtime_kind(array_quantum_properties.runtime_kind); + compute_kind.aggregate_value_kind(array_quantum_properties.value_kind); } // If either the index or the replacement value expressions are dynamic, then the content of the resulting array // expression is also dynamic. if index_expr_compute_kind.is_dynamic() || replacement_value_expr_compute_kind.is_dynamic() { - compute_kind.aggregate_runtime_kind(RuntimeKind::Dynamic); + compute_kind.aggregate_value_kind(ValueKind::Dynamic); } compute_kind @@ -1099,10 +1099,10 @@ impl<'a> Analyzer<'a> { let application_instance = self.get_current_application_instance(); let block_compute_kind = *application_instance.get_block_compute_kind(block_id); let mut compute_kind = ComputeKind::Classical; - compute_kind = compute_kind - .aggregate_runtime_features(condition_expr_compute_kind, RuntimeKind::Static); compute_kind = - compute_kind.aggregate_runtime_features(block_compute_kind, RuntimeKind::Static); + 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() { @@ -1183,7 +1183,7 @@ impl<'a> Analyzer<'a> { } else { entry_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features: ty_flags, - runtime_kind: RuntimeKind::Static, + value_kind: ValueKind::Static, }); } self.get_current_application_instance_mut() @@ -1526,10 +1526,10 @@ impl<'a> Analyzer<'a> { ); let mut updated_compute_kind = local_var_compute_kind.compute_kind; - // Since the local variable compute kind is what will be updated, the runtime kind must match the local + // Since the local variable compute kind is what will be updated, the value kind must match the local // variable's type. That is why before aggregating the compute kind of the assigned value we need to get - // a default runtime kind of the matching type. - // In some cases, there might be some loss of granularity on the runtime kind (e.g. assigning an array to + // a default value kind of the matching type. + // In some cases, there might be some loss of granularity on the value kind (e.g. assigning an array to // 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); @@ -1539,27 +1539,27 @@ impl<'a> Analyzer<'a> { // dynamic and additional runtime features may apply. if !application_instance.active_dynamic_scopes.is_empty() { let local_type = &assignee_expr.ty; - let mut dynamic_runtime_kind = RuntimeKind::new_dynamic_from_type(local_type); + let mut dynamic_value_kind = ValueKind::new_dynamic_from_type(local_type); let mut dynamic_runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - dynamic_runtime_kind, + dynamic_value_kind, local_type, ); update_features_for_type( local_type, &mut dynamic_runtime_features, - &mut dynamic_runtime_kind, + &mut dynamic_value_kind, ); let dynamic_compute_kind = ComputeKind::new_with_runtime_features( dynamic_runtime_features, - dynamic_runtime_kind, + dynamic_value_kind, ); updated_compute_kind = updated_compute_kind.aggregate(dynamic_compute_kind); } // If the updated compute kind is dynamic, include additional properties depending on the type of the // local variable. - if let Some(value_kind) = updated_compute_kind.runtime_kind() { + if let Some(value_kind) = updated_compute_kind.value_kind() { let ComputeKind::Quantum(updated_quantum_properties) = &mut updated_compute_kind else { @@ -1593,7 +1593,7 @@ impl<'a> Analyzer<'a> { ); updated_compute_kind = updated_compute_kind.aggregate_runtime_features( element_update_compute_kind, - RuntimeKind::Static, + ValueKind::Static, ); } updated_compute_kind @@ -1605,7 +1605,7 @@ impl<'a> Analyzer<'a> { .update_locals_compute_kind(*element_assignee_expr_id, value_expr_id); updated_compute_kind = updated_compute_kind.aggregate_runtime_features( element_update_compute_kind, - RuntimeKind::Static, + ValueKind::Static, ); } updated_compute_kind @@ -1675,20 +1675,20 @@ impl<'a> Analyzer<'a> { fn update_features_for_type( local_type: &Ty, dynamic_runtime_features: &mut RuntimeFeatureFlags, - dynamic_runtime_kind: &mut RuntimeKind, + dynamic_value_kind: &mut ValueKind, ) { match local_type { Ty::Array(..) => { // For arrays updated in a dynamic context, we also need to include the runtime feature - // of dynamic arrays and change the runtime kind. + // of dynamic arrays and change the value kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; - *dynamic_runtime_kind = 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 runtime kind. + // of dynamic tuples and change the value kind. *dynamic_runtime_features |= RuntimeFeatureFlags::UseOfDynamicTuple; - *dynamic_runtime_kind = 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 @@ -1733,11 +1733,11 @@ 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, RuntimeKind::Static); + block_compute_kind = + block_compute_kind.aggregate_runtime_features(stmt_compute_kind, ValueKind::Static); } - // Update the block's runtime kind if its non-unit, based on the runtime kind of its last statement's expression. + // Update the block's value kind if its non-unit, based on the value kind of its last statement's expression. if block.ty != Ty::UNIT { let last_stmt_id = block .stmts @@ -1749,11 +1749,11 @@ 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 = RuntimeKind::Static; + let mut block_value_kind = ValueKind::Static; last_expr_quantum_properties - .runtime_kind + .value_kind .project_onto_variant(&mut block_value_kind); - block_compute_kind.aggregate_runtime_kind(block_value_kind); + block_compute_kind.aggregate_value_kind(block_value_kind); } } } @@ -1902,15 +1902,15 @@ impl<'a> Visitor<'a> for Analyzer<'a> { // If the expression's compute kind is of the quantum variant, then we need to do a couple more things to get // the final compute kind for the expression. if let ComputeKind::Quantum(quantum_properties) = &mut compute_kind { - // Since the runtime kind does not handle all type structures (e.g. it does not handle the structure of a - // tuple type), there could be a mismatch between the expected runtime kind variant for the expression's type - // and the runtime kind that we got. + // Since the value kind does not handle all type structures (e.g. it does not handle the structure of 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 runtime_kind = RuntimeKind::Static; + let mut value_kind = ValueKind::Static; quantum_properties - .runtime_kind - .project_onto_variant(&mut runtime_kind); - quantum_properties.runtime_kind = runtime_kind; + .value_kind + .project_onto_variant(&mut value_kind); + quantum_properties.value_kind = value_kind; } // Finally, insert the expression's compute kind in the application instance. @@ -1989,11 +1989,11 @@ impl<'a> Visitor<'a> for Analyzer<'a> { self.visit_expr(*expr_id); // Use the expression compute kind to construct the statement compute kind, using only the expression - // runtime features since the runtime kind is meaningless for semicolon statements. + // 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, RuntimeKind::Static) + .aggregate_runtime_features(expr_compute_kind, ValueKind::Static) } StmtKind::Local(mutability, pat_id, value_expr_id) => { // Visit the expression to determine its compute kind. @@ -2003,11 +2003,11 @@ impl<'a> Visitor<'a> for Analyzer<'a> { self.bind_expr_compute_kind_to_pattern(*mutability, *pat_id, *value_expr_id); // Use the expression compute kind to construct the statement compute kind, using only the expression - // runtime features since the runtime kind is meaningless for local (binding) statements. + // 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, RuntimeKind::Static) + .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. @@ -2194,19 +2194,19 @@ fn derive_intrinsic_function_application_generator_set( // When a parameter is bound to a dynamic value, its type contributes to the runtime features used by the // function application. let runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - RuntimeKind::new_dynamic_from_type(¶m.ty), + ValueKind::new_dynamic_from_type(¶m.ty), ¶m.ty, ); - let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_context.output_type); + let value_kind = ValueKind::new_dynamic_from_type(&callable_context.output_type); let param_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }); // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => { - array_param_application_from_runtime_features(runtime_features, runtime_kind) + array_param_application_from_runtime_features(runtime_features, value_kind) } _ => ParamApplication::Element(param_compute_kind), }; @@ -2222,16 +2222,16 @@ fn derive_intrinsic_function_application_generator_set( fn array_param_application_from_runtime_features( runtime_features: RuntimeFeatureFlags, - runtime_kind: RuntimeKind, + value_kind: ValueKind, ) -> ParamApplication { ParamApplication::Array(ArrayParamApplication { static_size: ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }), dynamic_size: ComputeKind::Quantum(QuantumProperties { runtime_features: runtime_features | RuntimeFeatureFlags::UseOfDynamicallySizedArray, - runtime_kind, + value_kind, }), }) } @@ -2241,13 +2241,13 @@ fn derive_instrinsic_operation_application_generator_set( ) -> ApplicationGeneratorSet { assert!(matches!(callable_context.kind, CallableKind::Operation)); - // The runtime kind of intrinsic operations is inherently dynamic if their output is not `Unit` or `Qubit`. + // The value kind of intrinsic operations is inherently dynamic if their output is not `Unit` or `Qubit`. let runtime_kind = if callable_context.output_type == Ty::UNIT || callable_context.output_type == Ty::Prim(Prim::Qubit) { - RuntimeKind::Static + ValueKind::Static } else { - RuntimeKind::new_dynamic_from_type(&callable_context.output_type) + ValueKind::new_dynamic_from_type(&callable_context.output_type) }; let mut inherent_runtime_features = RuntimeFeatureFlags::empty(); @@ -2261,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, - runtime_kind, + value_kind: runtime_kind, }); // Determine the compute kind of all dynamic parameter applications. @@ -2273,19 +2273,19 @@ fn derive_instrinsic_operation_application_generator_set( // When a parameter is bound to a dynamic value, its type contributes to the runtime features used by the // operation application. let runtime_features = derive_runtime_features_for_value_kind_associated_to_type( - RuntimeKind::new_dynamic_from_type(¶m.ty), + ValueKind::new_dynamic_from_type(¶m.ty), ¶m.ty, ); - let runtime_kind = RuntimeKind::new_dynamic_from_type(&callable_context.output_type); + let value_kind = ValueKind::new_dynamic_from_type(&callable_context.output_type); let param_compute_kind = ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }); // Create a parameter application depending on the parameter type. let param_application = match ¶m.ty { Ty::Array(_) => { - array_param_application_from_runtime_features(runtime_features, runtime_kind) + array_param_application_from_runtime_features(runtime_features, value_kind) } _ => ParamApplication::Element(param_compute_kind), }; @@ -2341,21 +2341,19 @@ fn ty_prim_to_runtime_output_flag(prim: Prim) -> RuntimeFeatureFlags { #[allow(clippy::too_many_lines)] fn derive_runtime_features_for_value_kind_associated_to_type( - runtime_kind: RuntimeKind, + value_kind: ValueKind, ty: &Ty, ) -> RuntimeFeatureFlags { fn derive_runtime_features_for_value_kind_associated_to_array( - runtime_kind: RuntimeKind, + value_kind: ValueKind, content_type: &Ty, ) -> RuntimeFeatureFlags { let mut runtime_features = RuntimeFeatureFlags::empty(); - // A dynamic array is dynamically sized. - if runtime_kind == RuntimeKind::Dynamic { - // runtime_features |= RuntimeFeatureFlags::UseOfDynamicallySizedArray; - let content_runtime_kind = RuntimeKind::new_dynamic_from_type(content_type); + 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_runtime_kind, + content_value_kind, content_type, ); } @@ -2364,10 +2362,10 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_arrow( - runtime_kind: RuntimeKind, + value_kind: ValueKind, arrow: &Arrow, ) -> RuntimeFeatureFlags { - if runtime_kind == RuntimeKind::Static { + if value_kind == ValueKind::Static { return RuntimeFeatureFlags::empty(); } @@ -2378,10 +2376,10 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_primitive_type( - runtime_kind: RuntimeKind, + value_kind: ValueKind, prim: Prim, ) -> RuntimeFeatureFlags { - if runtime_kind == RuntimeKind::Static { + if value_kind == ValueKind::Static { return RuntimeFeatureFlags::empty(); } @@ -2402,18 +2400,18 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_primitive_tuple( - runtime_kind: RuntimeKind, + value_kind: ValueKind, element_types: &Vec, ) -> RuntimeFeatureFlags { - if runtime_kind == RuntimeKind::Static { + if value_kind == ValueKind::Static { return RuntimeFeatureFlags::empty(); } let mut runtime_features = RuntimeFeatureFlags::empty(); for element_type in element_types { - let element_runtime_kind = RuntimeKind::new_dynamic_from_type(element_type); + let element_value_kind = ValueKind::new_dynamic_from_type(element_type); runtime_features |= derive_runtime_features_for_value_kind_associated_to_type( - element_runtime_kind, + element_value_kind, element_type, ); } @@ -2421,34 +2419,34 @@ fn derive_runtime_features_for_value_kind_associated_to_type( } fn derive_runtime_features_for_value_kind_associated_to_udt( - runtime_kind: RuntimeKind, + value_kind: ValueKind, ) -> RuntimeFeatureFlags { - match runtime_kind { - RuntimeKind::Dynamic => RuntimeFeatureFlags::UseOfDynamicUdt, - RuntimeKind::Static => RuntimeFeatureFlags::empty(), + match value_kind { + ValueKind::Dynamic => RuntimeFeatureFlags::UseOfDynamicUdt, + ValueKind::Static => RuntimeFeatureFlags::empty(), } } match ty { Ty::Array(content_type) => { - derive_runtime_features_for_value_kind_associated_to_array(runtime_kind, content_type) + derive_runtime_features_for_value_kind_associated_to_array(value_kind, content_type) } Ty::Arrow(arrow) => { - derive_runtime_features_for_value_kind_associated_to_arrow(runtime_kind, arrow) + derive_runtime_features_for_value_kind_associated_to_arrow(value_kind, arrow) } Ty::Infer(_) => panic!("cannot derive runtime features for `Infer` type"), // Generic types do not require additional runtime features. Ty::Param(_) => RuntimeFeatureFlags::empty(), Ty::Prim(prim) => { - derive_runtime_features_for_value_kind_associated_to_primitive_type(runtime_kind, *prim) + derive_runtime_features_for_value_kind_associated_to_primitive_type(value_kind, *prim) } Ty::Tuple(element_types) => { derive_runtime_features_for_value_kind_associated_to_primitive_tuple( - runtime_kind, + value_kind, element_types, ) } - Ty::Udt(_) => derive_runtime_features_for_value_kind_associated_to_udt(runtime_kind), + Ty::Udt(_) => derive_runtime_features_for_value_kind_associated_to_udt(value_kind), Ty::Err => panic!("cannot derive runtime features for `Err` type"), } } diff --git a/source/compiler/qsc_rca/src/cyclic_callables.rs b/source/compiler/qsc_rca/src/cyclic_callables.rs index d44c46388a..b081653616 100644 --- a/source/compiler/qsc_rca/src/cyclic_callables.rs +++ b/source/compiler/qsc_rca/src/cyclic_callables.rs @@ -3,7 +3,7 @@ use crate::{ ApplicationGeneratorSet, ArrayParamApplication, ComputeKind, ParamApplication, - RuntimeFeatureFlags, RuntimeKind, common::LocalSpecId, cycle_detection::CycleDetector, + RuntimeFeatureFlags, ValueKind, common::LocalSpecId, cycle_detection::CycleDetector, scaffolding::InternalPackageStoreComputeProperties, }; use qsc_fir::{ @@ -143,13 +143,13 @@ impl<'a> Analyzer<'a> { Vec::::with_capacity(input_params.len()); for param in input_params { // If any parameter is dynamic, we assume the output of a function with cycles is also dynamic. - let runtime_kind = RuntimeKind::new_dynamic_from_type(output_type); + let value_kind = ValueKind::new_dynamic_from_type(output_type); // Since using cyclic functions with dynamic parameters requires advanced runtime capabilities, we use the // corresponding runtime feature. let param_compute_kind = ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::CallToCyclicFunctionWithDynamicArg, - runtime_kind, + value_kind, ); // Create a parameter application depending on the parameter type. @@ -276,10 +276,10 @@ fn create_operation_specialization_application_generator_set( ) -> ApplicationGeneratorSet { // Since operations can allocate and measure qubits freely, we assume its compute kind is quantum and that their // value kind is dynamic. - let runtime_kind = RuntimeKind::new_dynamic_from_type(output_type); + let value_kind = ValueKind::new_dynamic_from_type(output_type); let inherent_compute_kind = ComputeKind::new_with_runtime_features( RuntimeFeatureFlags::CyclicOperationSpec, - runtime_kind, + value_kind, ); // The compute kind of a cyclic operation for all dynamic parameter applications is the same as its inherent diff --git a/source/compiler/qsc_rca/src/lib.rs b/source/compiler/qsc_rca/src/lib.rs index b8d769a9f1..69d4f15311 100644 --- a/source/compiler/qsc_rca/src/lib.rs +++ b/source/compiler/qsc_rca/src/lib.rs @@ -366,8 +366,8 @@ impl ApplicationGeneratorSet { } ParamApplication::Array(array_param_application) => { if let ComputeKind::Quantum(quantum_properties) = arg_compute_kind { - match quantum_properties.runtime_kind { - RuntimeKind::Dynamic + match quantum_properties.value_kind { + ValueKind::Dynamic if quantum_properties .runtime_features .contains(RuntimeFeatureFlags::UseOfDynamicallySizedArray) => @@ -375,11 +375,11 @@ impl ApplicationGeneratorSet { compute_kind = compute_kind.aggregate(array_param_application.dynamic_size); } - RuntimeKind::Dynamic => { + ValueKind::Dynamic => { compute_kind = compute_kind.aggregate(array_param_application.static_size); } - RuntimeKind::Static => { + ValueKind::Static => { // No aggregation needed for static arrays. } } @@ -446,11 +446,11 @@ impl ComputeKind { #[must_use] pub fn new_with_runtime_features( runtime_features: RuntimeFeatureFlags, - runtime_kind: RuntimeKind, + value_kind: ValueKind, ) -> Self { Self::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }) } @@ -469,24 +469,24 @@ impl ComputeKind { }; // Determine the aggregated value kind. - let runtime_kind = match self { - Self::Classical => value_quantum_properties.runtime_kind, + let value_kind = match self { + Self::Classical => value_quantum_properties.value_kind, Self::Quantum(self_quantum_properties) => self_quantum_properties - .runtime_kind - .aggregate(value_quantum_properties.runtime_kind), + .value_kind + .aggregate(value_quantum_properties.value_kind), }; // Return the aggregated compute kind. ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }) } pub(crate) fn aggregate_runtime_features( self, value: ComputeKind, - default_runtime_kind: RuntimeKind, + default_value_kind: ValueKind, ) -> Self { let Self::Quantum(value_quantum_properties) = value else { // A classical compute kind has nothing to aggregate so just return the self with no changes. @@ -501,41 +501,42 @@ impl ComputeKind { } }; - // Use the runtime kind equivalent from self. - let runtime_kind = match self { - // If self was classical, the aggregated runtime kind is all static. - Self::Classical => default_runtime_kind, - Self::Quantum(self_quantum_properties) => self_quantum_properties.runtime_kind, + // Use the value kind equivalent from self. + let value_kind = match self { + // If self was classical, the aggregated value kind is all static. + Self::Classical => default_value_kind, + Self::Quantum(self_quantum_properties) => self_quantum_properties.value_kind, }; // Return the aggregated compute kind. ComputeKind::Quantum(QuantumProperties { runtime_features, - runtime_kind, + value_kind, }) } - pub(crate) fn aggregate_runtime_kind(&mut self, value: RuntimeKind) { + pub(crate) fn aggregate_value_kind(&mut self, value: ValueKind) { let Self::Quantum(quantum_properties) = self else { panic!("a value kind can only be aggregated to a compute kind of the quantum variant"); }; - quantum_properties.runtime_kind = quantum_properties.runtime_kind.aggregate(value); + 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.runtime_kind == RuntimeKind::Dynamic + quantum_properties.value_kind == ValueKind::Dynamic } } } - pub(crate) fn runtime_kind(self) -> Option { + pub(crate) fn value_kind(self) -> Option { match self { Self::Classical => None, - Self::Quantum(quantum_properties) => Some(quantum_properties.runtime_kind), + Self::Quantum(quantum_properties) => Some(quantum_properties.value_kind), } } } @@ -545,8 +546,8 @@ 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. - pub runtime_kind: RuntimeKind, + /// The kind of value produced by the program element. + pub value_kind: ValueKind, } impl Display for QuantumProperties { @@ -555,24 +556,24 @@ impl Display for QuantumProperties { write!(indent, "QuantumProperties:",)?; indent = set_indentation(indent, 1); write!(indent, "\nruntime_features: {:?}", self.runtime_features)?; - write!(indent, "\nruntime_kind: {}", self.runtime_kind)?; + write!(indent, "\nvalue_kind: {}", self.value_kind)?; Ok(()) } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum RuntimeKind { +pub enum ValueKind { Static, Dynamic, } -impl Display for RuntimeKind { +impl Display for ValueKind { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match &self { - RuntimeKind::Static => { + ValueKind::Static => { write!(f, "Static")?; } - RuntimeKind::Dynamic => { + ValueKind::Dynamic => { write!(f, "Dynamic")?; } } @@ -580,8 +581,8 @@ impl Display for RuntimeKind { } } -impl RuntimeKind { - pub(crate) fn aggregate(self, value: RuntimeKind) -> Self { +impl ValueKind { + pub(crate) fn aggregate(self, value: ValueKind) -> Self { match value { Self::Static => self, Self::Dynamic => Self::Dynamic, @@ -590,20 +591,20 @@ impl RuntimeKind { pub(crate) fn new_dynamic_from_type(ty: &Ty) -> Self { if *ty == Ty::UNIT { - // The associated runtime kind for a unit type is always static. + // 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 RuntimeKind) { + pub(crate) fn project_onto_variant(self, variant: &mut ValueKind) { match self { - RuntimeKind::Static => { + ValueKind::Static => { // No changes needed. } - RuntimeKind::Dynamic => { - *variant = RuntimeKind::Dynamic; + ValueKind::Dynamic => { + *variant = ValueKind::Dynamic; } } } diff --git a/source/compiler/qsc_rca/src/overrider.rs b/source/compiler/qsc_rca/src/overrider.rs index f4f87d17ac..7816b14a01 100644 --- a/source/compiler/qsc_rca/src/overrider.rs +++ b/source/compiler/qsc_rca/src/overrider.rs @@ -3,7 +3,7 @@ use crate::{ ApplicationGeneratorSet, ArrayParamApplication, ComputeKind, PackageId, ParamApplication, - QuantumProperties, RuntimeFeatureFlags, RuntimeKind, common::LocalSpecId, + QuantumProperties, RuntimeFeatureFlags, ValueKind, common::LocalSpecId, scaffolding::InternalPackageStoreComputeProperties, }; use qsc_fir::{ @@ -46,7 +46,7 @@ impl<'a> Overrider<'a> { static_size: ComputeKind::Classical, dynamic_size: ComputeKind::Quantum(QuantumProperties { runtime_features: RuntimeFeatureFlags::UseOfDynamicallySizedArray, - runtime_kind: RuntimeKind::Dynamic, + value_kind: ValueKind::Dynamic, }), }, )], diff --git a/source/compiler/qsc_rca/src/tests/arrays.rs b/source/compiler/qsc_rca/src/tests/arrays.rs index 037b130b55..b3973819cf 100644 --- a/source/compiler/qsc_rca/src/tests/arrays.rs +++ b/source/compiler/qsc_rca/src/tests/arrays.rs @@ -34,7 +34,7 @@ fn check_rca_for_array_with_dynamic_results() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -55,7 +55,7 @@ fn check_rca_for_array_with_dynamic_bools() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -89,7 +89,7 @@ fn check_rca_for_array_repeat_with_dynamic_result_value_and_classical_size() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -110,7 +110,7 @@ fn check_rca_for_array_repeat_with_dynamic_bool_value_and_classical_size() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -131,7 +131,7 @@ fn check_rca_for_array_repeat_with_classical_value_and_dynamic_size() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -155,7 +155,7 @@ fn check_rca_for_array_repeat_with_dynamic_double_value_and_dynamic_size() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -179,7 +179,7 @@ fn check_rca_for_mutable_array_statically_appended() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -203,7 +203,7 @@ fn check_rca_for_mutable_array_dynamically_appended() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -249,7 +249,7 @@ fn check_rca_for_mutable_array_assignment_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -270,7 +270,7 @@ fn check_rca_for_immutable_array_bound_to_dynamic_array() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -316,7 +316,7 @@ fn check_rca_for_mutable_array_assign_index_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -341,7 +341,7 @@ fn check_rca_for_mutable_array_assign_index_dynamic_content_in_dynamic_context() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -366,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) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -407,7 +407,7 @@ fn check_rca_for_access_using_dynamic_index() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble | UseOfDynamicIndex) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -430,7 +430,7 @@ fn check_rca_for_array_with_dynamic_size_bound_through_tuple() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -456,7 +456,7 @@ fn check_rca_for_array_with_dynamic_size_bound_through_tuple_from_callable() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -522,7 +522,7 @@ fn check_rca_for_array_with_static_size_bound_through_dynamic_tuple() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -561,7 +561,7 @@ fn check_rca_for_index_range_on_array_with_dynamic_contents() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -582,7 +582,7 @@ fn check_rca_for_indirect_length_on_array_with_dynamic_contents() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -604,7 +604,7 @@ fn check_rca_for_indirect_length_on_array_with_dynamic_length() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Dynamic + 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 3b7c52bd26..50a0f0922c 100644 --- a/source/compiler/qsc_rca/src/tests/assigns.rs +++ b/source/compiler/qsc_rca/src/tests/assigns.rs @@ -40,7 +40,7 @@ fn check_rca_for_dynamic_result_assign_to_local() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -63,7 +63,7 @@ fn check_rca_for_dynamic_bool_assign_to_local() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -88,7 +88,7 @@ fn check_rca_for_dynamic_int_assign_to_local() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -114,7 +114,7 @@ fn check_rca_for_dynamic_double_assign_to_local() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -244,7 +244,7 @@ fn check_rca_for_assign_dynamic_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); compilation_context.update( @@ -258,7 +258,7 @@ fn check_rca_for_assign_dynamic_call_result_to_tuple_of_vars() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -283,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) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); compilation_context.update( @@ -297,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) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -345,7 +345,7 @@ fn check_rca_for_mutable_classical_integer_assigned_updated_with_dynamic_integer ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -370,7 +370,7 @@ fn check_rca_for_mutable_dynamic_integer_assigned_updated_with_classical_integer ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -395,7 +395,7 @@ fn check_rca_for_mutable_dynamic_integer_assigned_updated_with_dynamic_integer() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -421,7 +421,7 @@ fn check_rca_for_mutable_dynamic_result_assigned_updated_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicResult) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -443,7 +443,7 @@ fn check_rca_for_immutable_dynamic_result_bound_to_dynamic_result() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicResult) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -470,7 +470,7 @@ fn check_rca_for_immutable_dynamic_result_bound_to_result_from_classical_conditi ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -499,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) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -547,7 +547,7 @@ fn check_rca_for_mutable_tuple_assigned_updated_in_dynamic_context() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicTuple) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -569,7 +569,7 @@ fn check_rca_for_immutable_tuple_bound_to_dynamic_tuple() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicTuple) - runtime_kind: 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 874c045c11..bd0b94d0b9 100644 --- a/source/compiler/qsc_rca/src/tests/bindings.rs +++ b/source/compiler/qsc_rca/src/tests/bindings.rs @@ -40,7 +40,7 @@ fn check_rca_for_immutable_dynamic_result_binding() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -80,7 +80,7 @@ fn check_rca_for_mutable_dynamic_bool_binding() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -122,7 +122,7 @@ fn check_rca_for_immutable_dynamic_int_binding() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -165,7 +165,7 @@ fn check_rca_for_mutable_dynamic_double_binding() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - runtime_kind: Dynamic + 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 165f91b3d0..c357645604 100644 --- a/source/compiler/qsc_rca/src/tests/binops.rs +++ b/source/compiler/qsc_rca/src/tests/binops.rs @@ -33,7 +33,7 @@ fn check_rca_for_bin_op_with_dynamic_lhs_and_classical_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -53,7 +53,7 @@ fn check_rca_for_bin_op_with_classical_lhs_and_dynamic_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -74,7 +74,7 @@ fn check_rca_for_bin_op_with_dynamic_lhs_and_dynamic_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -113,7 +113,7 @@ fn check_rca_for_nested_bin_ops_with_a_dynamic_operand() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -149,7 +149,7 @@ fn check_rca_for_exp_op_with_dynamic_lhs_and_classical_rhs() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -171,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) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -195,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) - runtime_kind: 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 7965aedc8c..3f246c0931 100644 --- a/source/compiler/qsc_rca/src/tests/callables.rs +++ b/source/compiler/qsc_rca/src/tests/callables.rs @@ -21,10 +21,10 @@ fn check_rca_for_function_in_core_package() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | UseOfDynamicallySizedArray | LoopWithDynamicCondition) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -138,7 +138,7 @@ fn check_rca_for_operation_with_one_classical_return_and_one_dynamic_return() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | ReturnWithinDynamicScope) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: adj: ctl: @@ -195,7 +195,7 @@ fn check_rca_for_callable_block_with_dynamic_unreachable_binding() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | ReturnWithinDynamicScope) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: adj: ctl: @@ -226,7 +226,7 @@ fn check_rca_for_test_callable() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: adj: ctl: @@ -246,35 +246,35 @@ fn check_rca_for_unrestricted_h() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -290,35 +290,35 @@ fn check_rca_for_base_h() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -334,47 +334,47 @@ fn check_rca_for_unrestricted_r1() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -390,47 +390,47 @@ fn check_rca_for_base_r1() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -446,47 +446,47 @@ fn check_rca_for_unrestricted_rx() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -502,47 +502,47 @@ fn check_rca_for_base_rx() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -558,59 +558,59 @@ fn check_rca_for_unrestricted_rxx() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -626,59 +626,59 @@ fn check_rca_for_base_rxx() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -694,47 +694,47 @@ fn check_rca_for_unrestricted_ry() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -750,47 +750,47 @@ fn check_rca_for_base_ry() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -806,59 +806,59 @@ fn check_rca_for_unrestricted_ryy() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -874,59 +874,59 @@ fn check_rca_for_base_ryy() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -942,47 +942,47 @@ fn check_rca_for_unrestricted_rz() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -998,47 +998,47 @@ fn check_rca_for_base_rz() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1054,59 +1054,59 @@ fn check_rca_for_unrestricted_rzz() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1122,59 +1122,59 @@ fn check_rca_for_base_rzz() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1190,35 +1190,35 @@ fn check_rca_for_unrestricted_s() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1234,35 +1234,35 @@ fn check_rca_for_base_s() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1278,35 +1278,35 @@ fn check_rca_for_unrestricted_t() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1322,35 +1322,35 @@ fn check_rca_for_base_t() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1366,35 +1366,35 @@ fn check_rca_for_unrestricted_x() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1410,35 +1410,35 @@ fn check_rca_for_base_x() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1454,35 +1454,35 @@ fn check_rca_for_unrestricted_y() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1498,35 +1498,35 @@ fn check_rca_for_base_y() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1542,35 +1542,35 @@ fn check_rca_for_unrestricted_z() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static"#]], + value_kind: Static"#]], ); } @@ -1586,34 +1586,34 @@ fn check_rca_for_base_z() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static ctl-adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: 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 c4338f9686..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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: 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 a6b400d3c5..c3219ec821 100644 --- a/source/compiler/qsc_rca/src/tests/cycles.rs +++ b/source/compiler/qsc_rca/src/tests/cycles.rs @@ -25,7 +25,7 @@ fn check_rca_for_one_function_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -56,7 +56,7 @@ fn check_rca_for_two_functions_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -73,7 +73,7 @@ fn check_rca_for_two_functions_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -106,7 +106,7 @@ fn check_rca_for_three_functions_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -122,7 +122,7 @@ fn check_rca_for_three_functions_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -138,7 +138,7 @@ fn check_rca_for_three_functions_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -166,7 +166,7 @@ fn check_rca_for_indirect_function_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -196,7 +196,7 @@ fn check_rca_for_indirect_chain_function_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -224,7 +224,7 @@ fn check_rca_for_indirect_tuple_function_cycle() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -252,7 +252,7 @@ fn check_rca_for_function_cycle_within_binding() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -281,7 +281,7 @@ fn check_rca_for_function_cycle_within_assignment() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -308,7 +308,7 @@ fn check_rca_for_function_cycle_within_return() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -336,7 +336,7 @@ fn check_rca_for_function_cycle_within_tuple() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -389,14 +389,14 @@ fn check_rca_for_function_cycle_within_call_input() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Array] ArrayParamApplication: static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -427,7 +427,7 @@ fn check_rca_for_function_cycle_within_if_block() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -458,7 +458,7 @@ fn check_rca_for_function_cycle_within_if_condition() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -488,7 +488,7 @@ fn check_rca_for_function_cycle_within_for_block() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -518,7 +518,7 @@ fn check_rca_for_function_cycle_within_while_block() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -547,7 +547,7 @@ fn check_rca_for_function_cycle_within_while_condition() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -574,13 +574,13 @@ fn check_rca_for_multi_param_recursive_bool_function() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -607,17 +607,17 @@ fn check_rca_for_multi_param_recursive_unit_function() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Array] ArrayParamApplication: static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Static + value_kind: Static dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToCyclicFunctionWithDynamicArg) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -642,11 +642,11 @@ fn check_rca_for_result_recursive_operation() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -671,20 +671,20 @@ fn check_rca_for_multi_param_result_recursive_operation() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic [3]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -709,11 +709,11 @@ fn check_rca_for_operation_body_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -743,19 +743,19 @@ fn check_rca_for_operation_body_adj_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static ctl: ctl-adj: "#]], ); @@ -784,20 +784,20 @@ fn check_rca_for_operation_body_ctl_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static ctl-adj: "#]], ); } @@ -825,20 +825,20 @@ fn check_rca_for_operation_multi_controlled_functor_recursion() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ctl: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static ctl-adj: "#]], ); } @@ -861,11 +861,11 @@ fn check_rca_for_operation_body_recursion_non_unit_return() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CyclicOperationSpec) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -893,11 +893,11 @@ fn check_rca_for_operation_body_recursion_preserves_inherent_capabilities() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicQubit | CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -931,11 +931,11 @@ fn check_rca_for_two_operation_cycle() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -950,11 +950,11 @@ fn check_rca_for_two_operation_cycle() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(CallToUnresolvedCallee) - runtime_kind: 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 91b798494f..483ea12fef 100644 --- a/source/compiler/qsc_rca/src/tests/ifs.rs +++ b/source/compiler/qsc_rca/src/tests/ifs.rs @@ -55,7 +55,7 @@ fn check_rca_for_if_stmt_with_dynamic_condition_and_classic_if_true_block() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Static + value_kind: Static dynamic_param_applications: adj: ctl: @@ -105,7 +105,7 @@ fn check_rca_for_if_else_expr_with_dynamic_condition_and_classic_branch_blocks() ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + 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 da2567109b..8293c43aaa 100644 --- a/source/compiler/qsc_rca/src/tests/intrinsics.rs +++ b/source/compiler/qsc_rca/src/tests/intrinsics.rs @@ -16,7 +16,7 @@ fn check_rca_for_quantum_rt_qubit_allocate() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: adj: ctl: @@ -36,11 +36,11 @@ fn check_rca_for_quantum_rt_qubit_release() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -59,11 +59,11 @@ fn check_rca_for_quantum_qis_m_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -86,7 +86,7 @@ fn check_rca_for_length() { static_size: Classical dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicallySizedArray) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -105,11 +105,11 @@ fn check_rca_for_quantum_qis_mresetz_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -130,7 +130,7 @@ fn check_rca_for_int_as_double() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -151,7 +151,7 @@ fn check_rca_for_int_as_big_int() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -188,11 +188,11 @@ fn check_rca_for_check_zero() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -213,7 +213,7 @@ fn check_rca_for_message() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -234,7 +234,7 @@ fn check_rca_for_arc_cos() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -255,7 +255,7 @@ fn check_rca_for_arc_sin() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -276,7 +276,7 @@ fn check_rca_for_arc_tan() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -297,10 +297,10 @@ fn check_rca_for_arc_tan_2() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -321,7 +321,7 @@ fn check_rca_for_cos() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -342,7 +342,7 @@ fn check_rca_for_cosh() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -363,7 +363,7 @@ fn check_rca_for_sin() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -384,7 +384,7 @@ fn check_rca_for_sinh() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -405,7 +405,7 @@ fn check_rca_for_tan() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -426,7 +426,7 @@ fn check_rca_for_tanh() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -447,7 +447,7 @@ fn check_rca_for_sqrt() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -468,7 +468,7 @@ fn check_rca_for_log() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -489,7 +489,7 @@ fn check_rca_for_truncate() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -508,17 +508,17 @@ fn check_rca_for_quantum_qis_ccx_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -537,14 +537,14 @@ fn check_rca_for_quantum_qis_cx_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -563,14 +563,14 @@ fn check_rca_for_quantum_qis_cy_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -589,14 +589,14 @@ fn check_rca_for_quantum_qis_cz_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -615,14 +615,14 @@ fn check_rca_for_quantum_qis_rx_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -641,17 +641,17 @@ fn check_rca_for_quantum_qis_rxx_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -670,14 +670,14 @@ fn check_rca_for_quantum_qis_ry_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -696,17 +696,17 @@ fn check_rca_for_quantum_qis_ryy_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -725,14 +725,14 @@ fn check_rca_for_quantum_qis_rz_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -751,17 +751,17 @@ fn check_rca_for_quantum_qis_rzz_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -780,11 +780,11 @@ fn check_rca_for_quantum_qis_h_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -803,11 +803,11 @@ fn check_rca_for_quantum_qis_s_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -826,11 +826,11 @@ fn check_rca_for_quantum_qis_s_adj() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -849,11 +849,11 @@ fn check_rca_for_quantum_qis_sx_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -872,11 +872,11 @@ fn check_rca_for_quantum_qis_t_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -895,11 +895,11 @@ fn check_rca_for_quantum_qis_t_adj() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -918,11 +918,11 @@ fn check_rca_for_quantum_qis_x_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -941,11 +941,11 @@ fn check_rca_for_quantum_qis_y_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -964,11 +964,11 @@ fn check_rca_for_quantum_qis_z_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -987,14 +987,14 @@ fn check_rca_for_quantum_qis_swap_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1013,11 +1013,11 @@ fn check_rca_for_quantum_qis_reset_body() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1036,14 +1036,14 @@ fn check_rca_for_draw_random_int() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -1062,14 +1062,14 @@ fn check_rca_for_draw_random_double() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -1088,11 +1088,11 @@ fn check_rca_for_draw_random_bool() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -1113,10 +1113,10 @@ fn check_rca_for_begin_estimate_caching() { dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - runtime_kind: Dynamic + value_kind: Dynamic [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic adj: ctl: ctl-adj: "#]], @@ -1153,25 +1153,25 @@ fn check_rca_for_account_for_estimates_internal() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Array] ArrayParamApplication: static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Static + value_kind: Static dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt | UseOfDynamicallySizedArray) - runtime_kind: Static + value_kind: Static [1]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Static + value_kind: Static [2]: [Parameter Type Array] ArrayParamApplication: static_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static dynamic_size: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicQubit | UseOfDynamicallySizedArray) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1190,11 +1190,11 @@ fn check_rca_for_begin_repeat_estimates_internal() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: [0]: [Parameter Type Element] Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicInt) - runtime_kind: Static + value_kind: Static adj: ctl: ctl-adj: "#]], @@ -1213,7 +1213,7 @@ fn check_rca_for_end_repeat_estimates_internal() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: adj: ctl: diff --git a/source/compiler/qsc_rca/src/tests/lambdas.rs b/source/compiler/qsc_rca/src/tests/lambdas.rs index 35a63448a7..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) - runtime_kind: 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) - runtime_kind: 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) - runtime_kind: Dynamic + 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) - runtime_kind: 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 4fbdefc50d..f0cb89ca59 100644 --- a/source/compiler/qsc_rca/src/tests/loops.rs +++ b/source/compiler/qsc_rca/src/tests/loops.rs @@ -41,7 +41,7 @@ fn check_rca_for_dynamic_for_loop() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | LoopWithDynamicCondition) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -85,7 +85,7 @@ fn check_rca_for_dynamic_repeat_until_loop_with_initial_dynamic_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | LoopWithDynamicCondition) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -112,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) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -135,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) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -163,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) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -205,7 +205,7 @@ fn check_rca_for_dynamic_while_loop_with_initial_dynamic_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | LoopWithDynamicCondition) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -231,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) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -253,7 +253,7 @@ fn check_rca_for_dynamic_while_loop_with_measurement_in_condition() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | MeasurementWithinDynamicScope | LoopWithDynamicCondition) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -282,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) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -310,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) - runtime_kind: 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 cd73696061..2663ad15df 100644 --- a/source/compiler/qsc_rca/src/tests/measurements.rs +++ b/source/compiler/qsc_rca/src/tests/measurements.rs @@ -19,7 +19,7 @@ fn check_rca_for_static_single_qubit_measurement() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -43,7 +43,7 @@ fn check_rca_for_dynamic_single_measurement() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(MeasurementWithinDynamicScope | UseOfDynamicResult) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -64,7 +64,7 @@ fn check_rca_for_static_single_measurement_and_reset() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -89,7 +89,7 @@ fn check_rca_for_dynamic_single_measurement_and_reset() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(MeasurementWithinDynamicScope | UseOfDynamicResult) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -110,7 +110,7 @@ fn check_rca_for_static_multi_qubit_measurement() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + 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 719a18c2a8..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) - runtime_kind: 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) - runtime_kind: 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 066138f3e3..77164c99e2 100644 --- a/source/compiler/qsc_rca/src/tests/qubits.rs +++ b/source/compiler/qsc_rca/src/tests/qubits.rs @@ -21,7 +21,7 @@ fn check_rca_for_static_single_qubit_allcation() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -51,7 +51,7 @@ fn check_rca_for_dynamic_single_qubit_allcation() { body: ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicQubit) - runtime_kind: Static + value_kind: Static dynamic_param_applications: adj: ctl: @@ -74,7 +74,7 @@ fn check_rca_for_static_multi_qubit_allcation() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -96,7 +96,7 @@ fn check_rca_for_dynamic_multi_qubit_allcation() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange | UseOfDynamicQubit | UseOfDynamicallySizedArray | LoopWithDynamicCondition) - runtime_kind: Dynamic + 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 1453fee72f..d6e3087ffe 100644 --- a/source/compiler/qsc_rca/src/tests/strings.rs +++ b/source/compiler/qsc_rca/src/tests/strings.rs @@ -33,7 +33,7 @@ fn check_rca_for_dynamic_string() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -67,7 +67,7 @@ fn check_rca_for_dynamic_interpolated_string() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicString) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -101,7 +101,7 @@ fn check_rca_for_dynamic_nested_interpolated_string() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -136,7 +136,7 @@ fn check_rca_for_dynamic_concatenated_string() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -170,7 +170,7 @@ fn check_rca_for_dynamic_string_comparison() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicString) - runtime_kind: Dynamic + 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 ea9b3f32f2..83c0775cd1 100644 --- a/source/compiler/qsc_rca/src/tests/structs.rs +++ b/source/compiler/qsc_rca/src/tests/structs.rs @@ -39,7 +39,7 @@ fn check_rca_for_struct_constructor_with_a_dynamic_value() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -81,7 +81,7 @@ fn check_rca_for_struct_copy_constructor_with_dynamic_value() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -104,7 +104,7 @@ fn check_rca_for_struct_dynamic_constructor_overwritten_with_classic_value() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - runtime_kind: Dynamic + 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 0d03f8f8b6..89d208e888 100644 --- a/source/compiler/qsc_rca/src/tests/types.rs +++ b/source/compiler/qsc_rca/src/tests/types.rs @@ -33,7 +33,7 @@ fn check_rca_for_dynamic_result() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -68,7 +68,7 @@ fn check_rca_for_dynamic_bool() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -105,7 +105,7 @@ fn check_rca_for_dynamic_int() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -139,7 +139,7 @@ fn check_rca_for_dynamic_pauli() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicPauli) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -174,7 +174,7 @@ fn check_rca_for_dynamic_range() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicRange) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -212,7 +212,7 @@ fn check_rca_for_dynamic_double() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicInt | UseOfDynamicDouble) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -246,7 +246,7 @@ fn check_rca_for_dynamic_big_int() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicBigInt) - runtime_kind: Dynamic + 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 2ccb4ce7f8..01d835fa8b 100644 --- a/source/compiler/qsc_rca/src/tests/udts.rs +++ b/source/compiler/qsc_rca/src/tests/udts.rs @@ -39,7 +39,7 @@ fn check_rca_for_udt_constructor_with_a_dynamic_value() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); } @@ -83,7 +83,7 @@ fn check_rca_for_udt_field_update_with_dynamic_value() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(UseOfDynamicBool | UseOfDynamicDouble | UseOfDynamicUdt) - runtime_kind: Dynamic + 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 9dff71e4bf..f312672a91 100644 --- a/source/compiler/qsc_rca/src/tests/vars.rs +++ b/source/compiler/qsc_rca/src/tests/vars.rs @@ -69,7 +69,7 @@ fn check_rca_for_static_qubit_var() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Static + value_kind: Static dynamic_param_applications: "#]], ); } @@ -90,7 +90,7 @@ fn check_rca_for_dynamic_result_var() { ApplicationsGeneratorSet: inherent: Quantum: QuantumProperties: runtime_features: RuntimeFeatureFlags(0x0) - runtime_kind: Dynamic + value_kind: Dynamic dynamic_param_applications: "#]], ); }