Skip to main contentIBM Quantum Documentation
Qiskit Transpiler Service is experimental and only available for IBM Quantum Premium Plan members.

CollectLinearFunctions

class qiskit_transpiler_service.ai.CollectLinearFunctions(do_commutative_analysis: bool = True, min_block_size: int = 4, max_block_size: int = LINEAR_MAX_BLOCK_SIZE, collect_from_back: bool = False, num_reps: int = 10)

Bases: RepeatedCollectAndCollapse

Collects blocks of SWAP and CX as LinearFunction objects and stores the original sub-circuit to compare against it after synthesis.

Parameters

  • do_commutative_analysis (bool(opens in a new tab), optional) – Enable or disable commutative analysis, defaults to True
  • min_block_size (int(opens in a new tab), optional) – Set the minimum size for blocks generated during the collect linear functions pass, defaults to 4.
  • max_block_size (int(opens in a new tab), optional) – Set the maximum size for blocks generated during the collect linear functions pass, defaults to 9.
  • collect_from_back (bool(opens in a new tab), optional) – Specify if collect blocks in reverse order or not, defaults to False.
  • num_reps (int(opens in a new tab), optional) – Specify how many times to repeat the optimization process, defaults to 10.

Methods

execute

execute(passmanager_ir, state, callback=None)

Execute optimization task for input Qiskit IR.

Parameters

Returns

Optimized Qiskit IR and state of the workflow.

Return type

tuple(opens in a new tab)[Any(opens in a new tab), PassManagerState]

name

name()

Name of the pass.

Return type

str(opens in a new tab)

run

run(dag)

Run the CollectLinearFunctions pass on dag. :param dag: the DAG to be optimized. :type dag: DAGCircuit

Returns

the optimized DAG.

Return type

DAGCircuit

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

Was this page helpful?
Report a bug or request content on GitHub.