Shallow duplicate

Header: tweedledum/algorithms/utility/shallow_duplicate.hpp

template<class CircuitOriginal, class Circuit>
Circuit tweedledum::shallow_duplicate(CircuitOriginal const &original, std::string_view name = {})

Creates a new circuit with same wires as the original.

This function requires a template parameter that cannot be inferred. Useful when duplicating into a different circuit type.

Return

A new circuit without gates.

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

  • name: The name of the new circuit (default: same as the original).

template<class Circuit>
Circuit tweedledum::shallow_duplicate(Circuit const &original, std::string_view name = {})

Creates a new circuit with same wires as the original.

Return

A new circuit without gates.

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

  • name: The name of the new circuit (default: same as the original).