This pull request adds the customGate flag to the CompoundOperation class. This flag is set for CompoundOperations that were constructed from custom gate calls.
The pull request also provides new functionality to the flattenOperations optimizer. Now, a second parameter can be used to indicate that only custom gates should be flattened. It makes sense to put this functionality here as outside of the CircuitOptimizer class, certain protected members cannot be accessed anymore.
Checklist:
[x] The pull request only contains commits that are related to it.
[x] I have added appropriate tests and documentation.
[x] I have made sure that all CI jobs on GitHub pass.
[x] The pull request introduces no new warnings and follows the project's style guidelines.
Description
This pull request adds the
customGate
flag to theCompoundOperation
class. This flag is set forCompoundOperations
that were constructed from custom gate calls.The pull request also provides new functionality to the
flattenOperations
optimizer. Now, a second parameter can be used to indicate that only custom gates should be flattened. It makes sense to put this functionality here as outside of theCircuitOptimizer
class, certain protected members cannot be accessed anymore.Checklist: