0
$\begingroup$

I am currently working on a variation of the Traveling Salesman Problem. For which I use the QUBO(Quadratic Unconstrained Binary Optimization). Within Qiskit there are potent functions to obtain the input graph as a QUBO model and transform it into an Ising-Hamiltonian. So far so good. Applying QAOA, I can also do and with that find a solution. Now I want to add error mitigation techniques, for that I want to use the python library mitiq. This library requires to apply its functions each time a circuit is calculated and measured. These measurements are naturally hidden when applying the qiskit functions.

An example is:

def executor(circuit, shots=20000):
    """Executes the input circuit and returns the noisy expectation value <A>, where A=|00>00|.
    """
    # Select a noisy backend
    noisy_backend = qiskit.IBMQ.load_account().get_backend("ibmq_manila")
    #noisy_backend = FakeLima() # Simulator with noise model similar to "ibmq_lima"

    # Append measurements
    circuit_to_run = circuit.copy()
    circuit_to_run.measure_all()

    # Run and get counts
    print(f"Executing circuit with {len(circuit)} gates using {shots} shots.")
    job=qt.execute(circuit_to_run,backend=backend,shots=shots,optimization_level=0)
    counts = job.result().get_counts()

    # Compute expectation value of the observable A=|0><0|
    noisy_value = counts["00"] / shots
    return noisy_value

To mitigate noise of this circuits measurement one must call the function:

zne_value = zne.execute_with_zne(circuit, executor)

After looking into the source code of qiskits MinimumEigenSolver and QAOA, it seems the only viable solution is to implement an eigensolver manually where I can implement an executor function as shown above.

Where do I find good resources or code examples to achieve this implementation given that I have already the Ising-Hamiltonian to start with?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.