Arcelyth/mqc/circuit/kernel does not have a README file

    LinearKernel

    pub(open) trait LinearKernel {
    fn size(Self) -> Int
    fn apply(Self, KernelArgs) -> Unit
    }

    A linear map from a local complex vector to one of the same size.

    UnitaryKernel

    pub(open) trait UnitaryKernel : LinearKernel {
    fn adjoint(Self) -> &UnitaryKernel
    }

    A linear kernel that preserves inner products.

    ControlledKernel

    pub(all) struct ControlledKernel {
    inner : &UnitaryKernel
    size : Int
    offset : Int
    }

    Apply a local kernel on one control block and identity on the others.

    ControlledKernel::adjoint

    ControlledKernel::apply

    fn ControlledKernel::apply(self : ControlledKernel, args : KernelArgs) -> Unit

    ControlledKernel::size

    fn ControlledKernel::size(self : ControlledKernel) -> Int

    DenseKernel

    pub(all) struct DenseKernel {
    data : Array[
    Complex
    ]
    size : Int
    }

    Kernel that applies a general dense unitary matrix. Stores the matrix in row-major order.

    DenseKernel::adjoint

    fn DenseKernel::adjoint(self : DenseKernel) -> &UnitaryKernel

    DenseKernel::apply

    fn DenseKernel::apply(self : DenseKernel, args : KernelArgs) -> Unit

    Multiply the row-order unitary matrix by the local input and write all outputs.

    DenseKernel::size

    fn DenseKernel::size(self : DenseKernel) -> Int

    KernelArgs

    pub(all) struct KernelArgs {
    input_re : ArrayView[Double]
    input_im : ArrayView[Double]
    output_re : MutArrayView[Double]
    output_im : MutArrayView[Double]
    }

    MonomialKernel

    pub(all) struct MonomialKernel {
    columns : Array[Int]
    phases : Array[
    Complex
    ]
    }

    A matrix with exactly one nonzero entry in each row and column. For Pauli Y, the column indices are 1 and 0, in row order.

    MonomialKernel::adjoint

    Invert the permutation and conjugate its phases.

    MonomialKernel::apply

    fn MonomialKernel::apply(self : MonomialKernel, args : KernelArgs) -> Unit

    Permute local inputs and multiply by one phase per output row.

    MonomialKernel::size

    fn MonomialKernel::size(self : MonomialKernel) -> Int

    ScaledKernel

    pub(all) struct ScaledKernel {
    inner : &LinearKernel
    scale : Double
    }

    Apply the inner linear kernel and multiply each output by a real scalar.

    ScaledKernel::apply

    fn ScaledKernel::apply(self : ScaledKernel, args : KernelArgs) -> Unit

    ScaledKernel::size

    fn ScaledKernel::size(self : ScaledKernel) -> Int