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)
folded = fold_gates_from_left(circ, scale_factor=2.)
print("Folded circuit:", folded, sep="\n")