deq-runtime 0.3.0

deq: Real-time Quantum Error Correction Decoding System
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JitLibrary {
    #[prost(string, tag = "1")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub gadget_types: ::prost::alloc::vec::Vec<JitGadgetType>,
    #[prost(message, repeated, tag = "3")]
    pub port_types: ::prost::alloc::vec::Vec<JitPortType>,
    #[prost(message, repeated, tag = "5")]
    pub program: ::prost::alloc::vec::Vec<JitInstruction>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnloadJitLibrary {
    /// unloading the jit will also unload all the error model types and check
    /// model types that are only used by the specified gadget types
    #[prost(uint64, repeated, tag = "1")]
    pub gtype: ::prost::alloc::vec::Vec<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JitPortType {
    #[prost(message, optional, tag = "1")]
    pub base: ::core::option::Option<super::bin::PortType>,
    #[prost(message, repeated, tag = "3")]
    pub stabilizers: ::prost::alloc::vec::Vec<jit_port_type::Stabilizer>,
    /// number of logical qubits encoded by this port type. Together with the
    /// observable list in `base`, this fixes the column layout of any matrix
    /// indexed by port observables: the first `2 * k` observables are logical
    /// (`LX_0, LZ_0, LX_1, LZ_1, ...`) and the remaining ones are stabilizer
    /// generators (one column per generator listed in `stabilizers`).
    #[prost(uint64, tag = "4")]
    pub k: u64,
}
/// Nested message and enum types in `JitPortType`.
pub mod jit_port_type {
    /// also need the information of the virtual stabilizer measurements
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Stabilizer {
        #[prost(string, tag = "1")]
        pub tag: ::prost::alloc::string::String,
        #[prost(message, optional, tag = "2")]
        pub relative: ::core::option::Option<super::super::visualizer::Position>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JitGadgetType {
    #[prost(message, optional, tag = "1")]
    pub base: ::core::option::Option<super::bin::GadgetType>,
    /// finished checks are those that only involves physical measurements and
    /// input virtual measurements; they can be expanded immediately and should
    /// be constructed in the check model that binds to this gadget
    #[prost(message, repeated, tag = "2")]
    pub finished_checks: ::prost::alloc::vec::Vec<jit_gadget_type::Check>,
    /// unfinished checks are those that involve ONE output virtual measurements;
    /// they cannot be expanded immediately because we don't know the future
    /// measurements yet. The number of unfinished checks should be equal to the
    /// number of output stabilizers. Note that the check is excluding the output
    /// virtual stabilizer measurement because it is implied by the check index.
    #[prost(message, repeated, tag = "3")]
    pub unfinished_checks: ::prost::alloc::vec::Vec<jit_gadget_type::Check>,
    #[prost(message, repeated, tag = "4")]
    pub errors: ::prost::alloc::vec::Vec<jit_gadget_type::Error>,
}
/// Nested message and enum types in `JitGadgetType`.
pub mod jit_gadget_type {
    /// define how to dynamically generate the check model for this gadget
    /// the check model is generated immediately when the JIT gadget is
    /// instantiated: it includes those finished checks (which, by definition,
    /// involves only current and past measurements and thus satisfies the deq bin
    /// semantics) and updates the unfinished checks in the JIT compiler.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PresentMeasurement {
        /// if the measurement comes from an input port stabilizer, the port index is
        /// provided; otherwise the measurement refers to a physical measurement of
        /// this gadget
        #[prost(uint64, optional, tag = "1")]
        pub input_port: ::core::option::Option<u64>,
        /// if input port is not set, then this is the physical measurement index of
        /// the current gadget. Otherwise, it is a virtual measurement from an input
        /// port, and the index refers to the stabilizer index in the JIT port type
        #[prost(uint64, tag = "2")]
        pub measurement_index: u64,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Check {
        /// reuse the base error definition in deq bin, but ignore the field of
        /// remote measurements because here we only refer to local measurements
        /// (virtual or not).
        #[prost(message, optional, tag = "1")]
        pub base: ::core::option::Option<super::super::bin::check_model_type::Check>,
        #[prost(message, repeated, tag = "2")]
        pub measurements: ::prost::alloc::vec::Vec<PresentMeasurement>,
    }
    /// define how to dynamically generate the error model for this gadget. Just
    /// like the error model in deq bin, an error happening inside a gadget
    /// belongs to the gadget's attaching error model. However, in JIT compilation,
    /// the error model may not be immediately generated because some of the errors
    /// trigger unfinished checks, which themselves have not been generated yet.
    /// Even worse, due to the updates of unfinished checks, the degree of the
    /// hyperedge is not determined yet. For example, an error triggering one
    /// unfinished check might end up with triggering multiple checks due to
    /// transversal logical CNOTs that propagates the error effect to multiple
    /// logical qubits. In the JIT compiler, such errors are recorded in the memory
    /// until all its referring unfinished checks are resolved. Only when all the
    /// errors are resolved, an error model is generated and attached to the check
    /// model.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Error {
        /// reuse the base error definition in deq bin, but ignore the field of
        /// remote checks because here we only refer to local checks (finished or
        /// not).
        #[prost(message, optional, tag = "1")]
        pub base: ::core::option::Option<super::super::bin::error_model_type::Error>,
        /// the list of finished checks that it triggers
        #[prost(uint64, repeated, tag = "2")]
        pub finished_checks: ::prost::alloc::vec::Vec<u64>,
        /// the list of unfinished checks that it triggers; if left empty, then the
        /// error is resolved immediately; otherwise, it will wait until all the
        /// unfinished checks and its propagated ones are completely resolved
        #[prost(uint64, repeated, tag = "3")]
        pub unfinished_checks: ::prost::alloc::vec::Vec<u64>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JitInstruction {
    /// unlike the instruction in deq-bin which can instantiate either a gadget,
    /// a check model or an error model, here in JIT compilation an instruction
    /// can only instantiate a gadget, because the check model and error model are
    /// dynamically generated based on the checks and errors defined in the JIT
    /// gadget type.
    #[prost(message, optional, tag = "1")]
    pub gadget: ::core::option::Option<super::bin::Gadget>,
    /// modify the probability of the errors
    #[prost(message, optional, tag = "2")]
    pub probability_modifier: ::core::option::Option<super::bin::ProbabilityModifier>,
}