コード例 #1
0
def expect_and_grad_nochunking(  # noqa: F811
    vstate: MCState,
    operator: AbstractOperator,
    use_covariance: Bool,
    chunk_size: None,
    *args,
    **kwargs,
):
    return expect_and_grad(vstate, operator, use_covariance, *args, **kwargs)
コード例 #2
0
def expect_and_grad_fallback(  # noqa: F811
    vstate: MCState,
    operator: AbstractOperator,
    use_covariance: Bool,
    chunk_size: Any,
    *args,
    **kwargs,
):
    warnings.warn(
        f"Ignoring chunk_size={chunk_size} for expect_and_grad method with signature "
        f"({type(vstate)}, {type(operator)}) because no implementation supporting "
        f"chunking for this signature exists."
    )

    return expect_and_grad(vstate, operator, use_covariance, *args, **kwargs)