Giter VIP home page Giter VIP logo

Comments (2)

mberna avatar mberna commented on June 2, 2024 2
  • Update extrapolator(s) to handle zero variance smoothly, introducing support for the identity observable.

I would prioritize this step over the other two. The rest sounds good to me.

from prototype-zne.

pedrorrivero avatar pedrorrivero commented on June 2, 2024

Thanks for reporting this @mberna, read below for my initial assessment (c.c. @1ucian0).

Note

Because of the nature of this issue, it is very limited in scope and unlikely to affect anything other than trivial computations or misuses of the tool (e.g. to mitigate errors on a zero-noise/ideal simulator and under especial circumstances).

Observations

  1. Due to the observable being the trivial one (i.e. identity III...) the expectation value is always 1.0 with variance 0.0 regardless of the circuit, (level of) noise, or anything else. Because of such null variance, the scipy.curvefit extrapolation fails while trying to compute the induced error bar —a feature that came out in version 1.1.0.

  2. Real world cases where the variance is zero are highly unlikely to occur —if they ever do— since they arise in scenarios where the computation is fully deterministic: a condition that is rarely met for expectation value calculations via sampling even in the absence of noise (i.e. only if the state is an eigenstate of the observable and measurement takes place in an eigenbasis).

  3. In the following line you are requesting to amplify the noise only on two-qubit gates:

    zne_strategy = ZNEStrategy(noise_factors=[1, 3, 5], noise_amplifier=TwoQubitAmplifier())

    Since there are no such gates in your circuit (before decomposition), the noise amplification fails with a warning:

    UserWarning: Noise amplification is not performed since none of the gates are folded.
  4. TwoQubitAmplifier is the default behavior if no explicit amplifier is passed since version 1.0.0rc0 —improving upon the previous default CxAmplifier which only addresses CNOT gates. This is especially intended for use with already transpiled circuits, where all gates are going to be either one or two-qubit gates. For this particular case, something like the vanilla LocalFoldingAmplifier or GlobalFoldingAmplifier would be more suited.

Next steps

  • Update extrapolator(s) to handle zero variance smoothly, introducing support for the identity observable.
  • Build a new MultiQubitAmplifier which will amplify noise in all gates with num_qubits > 1.
  • Set such MultiQubitAmplifier as the new default in ZNEStrategy.

Please, let me know if you agree to this and I will proceed.

from prototype-zne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.