Skip to main contentIBM Quantum Documentation Mirror

CustomF2QLayout

class CustomF2QLayout(layout)

Bases: GenericPass[DAGCircuit, DAGCircuit]

Sets the user-provided F2QLayout in the transpiler.

This pass simply populates the f2q_layout field of the property_set, with the value of layout.

Note

It is the user’s responsibility to ensure that subsequently used transpilation passes (and plugins) are configured to adhere to this F2QLayout correctly.

Initializing this transpiler pass can be done with the arguments listed below.

Parameters

layout (F2QLayout) – the custom f2q_layout to use.


Attributes

layout

Type: F2QLayout

The user-provided mapping of FermionicRegister to QuantumRegister.


Methods

run

run(dag)

Runs this analysis pass.

Parameters

dag (DAGCircuit) – the DAG circuit representation of a FermionicCircuit.

Returns

The unchanged input. But the property_set of this transpilation pipeline will be updated.

Return type

DAGCircuit

Inherited Methods

execute

execute(passmanager_ir, state, callback=None)

Execute optimization task for input Qiskit IR.

Parameters

  • passmanager_ir (IR) – Qiskit IR to optimize.
  • state (PassManagerState) – State associated with workflow execution by the pass manager itself.
  • callback (Callable[[Task, IR_OUT, PropertySet, float, int], None] | None) – A callback function which is called per execution of optimization task.

Returns

Optimized Qiskit IR and state of the workflow.

Return type

tuple[IR_OUT, PassManagerState]

name

name()

Name of the pass.

Return type

str

update_status

update_status(state, run_state)

Update workflow status.

Parameters

  • state (PassManagerState) – Pass manager state to update.
  • run_state (RunState) – Completion status of current task.

Returns

Updated pass manager state.

Return type

PassManagerState