2
$\begingroup$

I'm currently implementing some algorithms on IBM quantum devices. After the migration to qiskit 1.0, I started using primitives and SamplerV2.

What I observed is that even if I manually select a specific initial mapping of virtual qubits to virtual ones to minimize circuit depth, once I run the circuit the metrics of the job tell me that actually a circuit of bigger depth has been run. The circuit is already expressed in terms of native gates.

In fact, in general, I'm getting more noisy results with respect to other computations I did pre-migration.

After various attempts, it seems to me that SamplerV2 is modifying in some way the circuit and I would like to understand how to avoid this.

Does someone know if this is what is really happening and how to solve the problem?

Thanks!

$\endgroup$
2
  • 1
    $\begingroup$ Can you please share a minimal working example of your code $\endgroup$ May 14 at 15:49
  • $\begingroup$ Sure! First I define my transpiler: pm=generate_preset_pass_manager(backend=backend,initial_layout=[0,1,2,3,4, 61,60,53,41,40]). where the mapping is defined in initial_layout. When I define the circuit qc, I transpile it using pm.run(qc). I call the sampler as sampler = Sampler(backend=backend) and run job=sampler.run(qc,shots=20000) $\endgroup$ May 15 at 14:30

1 Answer 1

0
$\begingroup$

Try sampler.options.twirling.enable_measure = False. Make sure that you've installed the latest qiskit-ibm-runtime.

$\endgroup$
1
  • $\begingroup$ It seems this is not the problem. However, I realized that when I run the circuit the following warning message is given: "qctrl._warn_and_clean_options_v2:WARNING:2024-05-15 16:27:50,807: The following settings cannot be customized and will be overwritten: dynamical_decoupling,twirling". I don't know if this means that I'm not changing the twirling setting $\endgroup$ May 17 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.