Remove marked

Header: tweedledum/algorithms/transformation/remove_marked.hpp

template<class NewCircuit, class Circuit>
NewCircuit tweedledum::remove_marked(Circuit const &original)

Remove marked operations.

For this function a node is marked when its value, returned by circuit.value(node), is not zero. A new circuit is created and all nodes that are not marked will be copied into it.

NOTE: This function requires a template parameter that cannot be inferred. This is useful when removing nodes and creating a different circuit representation, e.g. op_dag <-> netlist

NOTE: Operation type must be the same.

Return

A new circuit without the marked operations.

Parameters
  • original: The original quantum circuit (will not be modified).

template<class Circuit>
Circuit tweedledum::remove_marked(Circuit const &original)

Remove marked operations.

For this function a node is marked when its value, returned by circuit.value(node), is not zero. A new circuit is created and all nodes that are not marked will be copied into it.

NOTE: the input and output networs are of the same type.

Return

A new circuit without the marked operations.

Parameters
  • original: The original quantum circuit (will not be modified).