# Layout Method in qiskit

Using transpile with optimization_level = 3, which is the layout method used by default?

DenseLayout is used by default. You can see the code for the optimization level here and it is this line that sets the default to be the dense layout.

• Thank you very much. But in your opinion using as layout method noise_adaptive give best perfomances ? I'm tring to understand which layout method allows to have the best performances – Roberto May 11 '20 at 11:26
• If you are going to be running it on the hardware it might be worth trying NoiseAdaptive too, it may be better but the only way to know for sure it to experiment! :) if this answer answered your question would you mind marking it as accepted? – met927 May 11 '20 at 11:31
• Thanks again. Just another question: for what you know there is a way to check which layout is better whitout execute the jobs ? Maybe using simulations o something like that ? – Roberto May 11 '20 at 13:40
• You could try using a simulator with a NoiseModel corresponding to the device you eventually want to run the circuit on – met927 May 11 '20 at 13:46

You can pass a layout_method=... arg to set this yourself. It currently accepts 'dense', 'noise_adaptive' and 'trivial'.

(There is a also an option for routing_method=... which accepts 'basic', 'stochastic' and 'lookahead'.)

The difference between the various levels (0,1,2,3) is then what parameters these passes run with. At higher level, they run with more time-consuming parameters which will probably yield better results. For example the number of trials is higher, or the lookahead window is larger.

• Thanks. I ask you the same question I asked to met927: for what you know there is a way to check which layout is better whitout execute the jobs ? Maybe using simulations o something like that ? – Roberto May 11 '20 at 13:44
• Yes you can simulate it using a noise model based on that device's parameters. There's a tutorial on that here: github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/… – Ali Javadi May 11 '20 at 18:18