Function deep_copy

Source
pub fn deep_copy(
    circuit: &Circuit,
    name_mapper: impl NameMapper,
) -> Result<Circuit, String>
Expand description

Creates a deep / independent copy of the given circuit. The name_mapper is responsible for returning new names for the inputs and outputs. If the name_mapper returns existing names for inputs, these gates will still be shared, since input nodes are identified by their names.

The name mapper will only be called once for each input or output name.

Returns the new circuit.