Skip to content

[Panic] qsc_rca: nested parameter tuple called with a tuple variable #3845

Description

@amcasey

Likely cause: map_input_pattern_to_input_expressions returns one argument per top-level element of the parameter pattern rather than one per flattened leaf.

  • Crate: qsc_rca
  • Panic: lib.rs:351, in generate_application_compute_kind
  • Stage / profile: compiling the source (harness eval step, runtime capabilities analysis), Base, Adaptive_RI, Adaptive_RIF and Adaptive
  • Message: application generator recorded 4 parameter applications for 3 runtime arguments
namespace Test {
    operation F((a : Int, (b : Int, c : Int)), q : Qubit) : Unit {
        if a + b + c > 2 { X(q); }
    }
    @EntryPoint(Adaptive_RI)
    operation Main() : Result {
        use q = Qubit();
        H(q);
        let r = MResetZ(q) == One ? 1 | 0;
        let t = (r, (2, r));
        F(t, q);
        MResetZ(q)
    }
}

A lambda with a single tuple parameter panics at core.rs:2899 in map_input_pattern_to_input_expressions (expected tuple pattern for lambda receiving multiple arguments):

@EntryPoint(Adaptive_RIF)
operation Main() : Result {
    use q = Qubit();
    let h = t -> t == (1, 2);
    if h((1, 2)) { X(q); }
    MResetZ(q)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions