Quanlse/remoteZNE.py
def remoteZNEMitigation(rho: np.ndarray,
                        circuit: List[CircuitLine] = None,
                        A: np.ndarray = None,
                        ham: QHam = None,
                        order: int = 1) -> Tuple[float, List[float], List[float]]:
    r"""
    Use the extrapolation method to mitigate the expectation value:

    :math:`{\rm Tr}[A C_n\cdots C_1 \rho C_1^\dagger \cdots C_n^\dagger]`

    under the assumption that the implementation of :math:`C_i` suffer from noise.
    More specifically, the hamiltonian designed to implement the
    quantum circuit :math:`C_n ... C_1` is not perfect.

    If `order` is not set, it will set to 1 by default.
    The Richardson extrapolation method will be applied.
    The return value will be of the form:

    `mitigatedValue, [coefficients], [noisy values]`

    where the `[coefficients]` and `[noisy values]` are the data points
    used to accomplish the Richardson extrapolation, each of size `order+1`.

    :param rho: the input quantum state
    :param circuit: the quantum circuit in Quantum Leaf syntax
    :param A: the quantum observable
    :param ham: the system Hamiltonian designed to implement the quantum circuit.
                It may be generated by Scheduler or optimizers.
    :param order: the order of the error to be extrapolated.
                Must be a positive integer.
    :return: The error mitigated expectation value and possibly
                a list of coefficients and noisy expectation values.
    """
    args = [
        numpyMatrixToDictMatrix(rho),
        circuitLineDump(circuit),
        numpyMatrixToDictMatrix(A),
        ham.dump(),
        order
    ]
    kwargs = {}

    origin = rpcCall("zneMitigation", args, kwargs)

    return origin["mitigatedValue"], origin["infidelities"], origin["noisyValues"]
r"""
    Use the extrapolation method to mitigate the expectation value:

    :math:`{\rm Tr}[A C_n\cdots C_1 \rho C_1^\dagger \cdots C_n^\dagger]`

    under the assumption that the implementation of :math:`C_i` suffer from noise.
    More specifically, the hamiltonian designed to implement the
    quantum circuit :math:`C_n ... C_1` is not perfect.

    If `order` is not set, it will set to 1 by default.
    The Richardson extrapolation method will be applied.
    The return value will be of the form:

    `mitigatedValue, [coefficients], [noisy values]`

    where the `[coefficients]` and `[noisy values]` are the data points
    used to accomplish the Richardson extrapolation, each of size `order+1`.

    :param rho: the input quantum state
    :param circuit: the quantum circuit in Quantum Leaf syntax
    :param A: the quantum observable
    :param ham: the system Hamiltonian designed to implement the quantum circuit.
                It may be generated by Scheduler or optimizers.
    :param order: the order of the error to be extrapolated.
                Must be a positive integer.
    :return: The error mitigated expectation value and possibly
                a list of coefficients and noisy expectation values.
    
r"""
Use the extrapolation method to mitigate the expectation value.
r " " " Use the extrapolation method to mitigate the expectation value .
def remoteZNEMitigation(rho: np.ndarray,
                        circuit: List[CircuitLine] = None,
                        A: np.ndarray = None,
                        ham: QHam = None,
                        order: int = 1) -> Tuple[float, List[float], List[float]]:
    args = [
        numpyMatrixToDictMatrix(rho),
        circuitLineDump(circuit),
        numpyMatrixToDictMatrix(A),
        ham.dump(),
        order
    ]
    kwargs = {}
    origin = rpcCall("zneMitigation", args, kwargs)
    return origin["mitigatedValue"], origin["infidelities"], origin["noisyValues"]
def remoteZNEMitigation ( rho : np . ndarray , circuit : List [ CircuitLine ] = None , A : np . ndarray = None , ham : QHam = None , order : int = 1 ) -> Tuple [ float , List [ float ] , List [ float ] ] : args = [ numpyMatrixToDictMatrix ( rho ) , circuitLineDump ( circuit ) , numpyMatrixToDictMatrix ( A ) , ham . dump ( ) , order ] kwargs = { } origin = rpcCall ( "zneMitigation" , args , kwargs ) return origin [ "mitigatedValue" ] , origin [ "infidelities" ] , origin [ "noisyValues" ]
r"""
Use the extrapolation method to mitigate the expectation value:
r " " " Use the extrapolation method to mitigate the expectation value :
r"""
    Use the extrapolation method to mitigate the expectation value:

    :math:`{\rm Tr}[A C_n\cdots C_1 \rho C_1^\dagger \cdots C_n^\dagger]`

    under the assumption that the implementation of :math:`C_i` suffer from noise.
    More specifically, the hamiltonian designed to implement the
    quantum circuit :math:`C_n ... C_1` is not perfect.

    If `order` is not set, it will set to 1 by default.
    The Richardson extrapolation method will be applied.
    The return value will be of the form:

    `mitigatedValue, [coefficients], [noisy values]`

    where the `[coefficients]` and `[noisy values]` are the data points
    used to accomplish the Richardson extrapolation, each of size `order+1`.

    :param rho: the input quantum state
    :param circuit: the quantum circuit in Quantum Leaf syntax
    :param A: the quantum observable
    :param ham: the system Hamiltonian designed to implement the quantum circuit.
                It may be generated by Scheduler or optimizers.
    :param order: the order of the error to be extrapolated.
                Must be a positive integer.
    :return: The error mitigated expectation value and possibly
                a list of coefficients and noisy expectation values.
    """
The error mitigated expectation value and possibly
a list of coefficients and noisy expectation values.
The error mitigated expectation value and possibly a list of coefficients and noisy expectation values .
rho
np.ndarray
the input quantum state
the input quantum state
circuit
List[CircuitLine]
the quantum circuit in Quantum Leaf syntax
the quantum circuit in Quantum Leaf syntax
A
np.ndarray
the quantum observable
the quantum observable
ham
QHam
the system Hamiltonian designed to implement the quantum circuit.
It may be generated by Scheduler or optimizers.
the system Hamiltonian designed to implement the quantum circuit . It may be generated by Scheduler or optimizers .
order
int
the order of the error to be extrapolated.
Must be a positive integer.
the order of the error to be extrapolated . Must be a positive integer .
math
`{\rm Tr}[A C_n\cdots C_1 \rho C_1^\dagger \cdots C_n^\dagger]`
under the assumption that the implementation of :math:`C_i` suffer from noise.
More specifically, the hamiltonian designed to implement the
quantum circuit :math:`C_n ... C_1` is not perfect.

If `order` is not set, it will set to 1 by default.
The Richardson extrapolation method will be applied.
The return value will be of the form.

`mitigatedValue, [coefficients], [noisy values]`


` { \ rm Tr } [ A C_n \ cdots C_1 \ rho C_1^ \ dagger \ cdots C_n^ \ dagger ] ` under the assumption that the implementation of : math : ` C_i ` suffer from noise . More specifically the hamiltonian designed to implement the quantum circuit : math : ` C_n ... C_1 ` is not perfect . If ` order ` is not set it will set to 1 by default . The Richardson extrapolation method will be applied . The return value will be of the form . ` mitigatedValue [ coefficients ] [ noisy values ] `