pub fn circom_to_lambda(
    circom_r1cs: CircomR1CS,
    witness: CircomWitness,
) -> (QuadraticArithmeticProgram, Vec<FrElement>, Vec<FrElement>) {
    let num_of_outputs = circom_r1cs.num_outputs;
    let num_of_pub_inputs = circom_r1cs.num_pub_inputs;

    // we could get a slice using the QAP but the QAP does not keep track of the number of private inputs;
    // so instead we get the public signals here
    let public_inputs = witness[..num_of_pub_inputs + num_of_outputs + 1].to_vec();

    // get L,R,O matrices from R1CS
    let [l, r, o] = build_lro_from_circom_r1cs(circom_r1cs);
    let qap = QuadraticArithmeticProgram::from_variable_matrices(public_inputs.len(), &l, &r, &o);

    (qap, witness, public_inputs)
}
Given a [`CircomR1CS`] and [`CircomWitness`] it returns a [QAP](QuadraticArithmeticProgram),
witness, and public signals; all compatible with Lambdaworks.
crates/provers/groth16/circom-adapter/src/lib.rs