2
$\begingroup$

I'm reading the mitiq zero noise extrapolation documentation and I just can't make sense of how the scale_factor for folding work.

"The minimum scale factor is one (which corresponds to folding no gates). A scale factor of three corresponds to folding all gates locally. Scale factors beyond three begin to fold gates more than once."

Doc: https://mitiq.readthedocs.io/en/stable/guide/guide-zne.html

I made a quick qiskit example for convenience:

import qiskit as q
from mitiq.zne.scaling import fold_gates_from_left

n_qubits = 4
circ = QuantumCircuit(n_qubits)


circ.h(0)
for qubit in range(n_qubits - 1):
    circ.cx(qubit, qubit + 1)
circ.measure_all()
print(circ)

enter image description here

folded = fold_gates_from_left(circ, scale_factor=2.)
print("Folded circuit:", folded, sep="\n") 

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

If the input circuit has d_in gates, after applying unitary folding, one gets a circuit of d_out >= d_in gates. The scale_factor (approximately) determines how much you want to scale d_out with respect to d_in. In other words, a subset of gates are folded such that d_out is approximately equal to scale_factor * d_in.

In your example:

d_in = 4
d_out = 8
scale_factor = 2.0

and indeed d_out is equal to scale_factor * d_in.

$\endgroup$

Your Answer

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

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