Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEC using Mitiq #2505

Open
Julie-Maria-Raju opened this issue Sep 21, 2024 · 1 comment
Open

PEC using Mitiq #2505

Julie-Maria-Raju opened this issue Sep 21, 2024 · 1 comment

Comments

@Julie-Maria-Raju
Copy link

Julie-Maria-Raju commented Sep 21, 2024

I was trying error mitigation with PEC my idea is to classify an image with a quantum circuit followed by a classical FC.
I need to measure expectation value of each qubit and want to get the pec values for each qubit but when I use observable I can only use ("ZZ") ie as tensor product of expectation values. Is there any way to find expectation values of each qubit and get pec values for each qubit.

observable = Observable(PauliString("XZ"), PauliString("YY")).matrix()

ideal simulator

def ideal_execute(circuit):
    """Simulate (training) circuits without noise"""
    circuit_copy = circuit.copy()
    noise_model = initialized_depolarizing_noise(0.0)
    return execute_with_noise(circuit_copy, observable, noise_model)

I want to define observable different than above to get each qubits expectation value.

@natestemen
Copy link
Member

Cool use case! I hope error mitigation will be helpful here.

Can you create an observable using the support keyword argument like this?

obs = Observable(PauliString("Z", support=(i,)) for i in range(num_qubits))

This will mean each PauliString will only act on the qubit i. More details in the mitiq.PauliString API-doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants