The Circuit is a collection of gates. Since for the execution of these gates is important that these form a directed acyclic graph (DAG), the correct way of building this circuit is using the CircuitBuilder
The CircuitBuilder API ensures that the gates are ordered topologically, this means in the order they should be executed taking dependencies into account
Here is our only constrain for the gates, they have to implement the Component trait, this means that they should be able to return an iterator over the nodes.
Description
This PR aims to introduce a new generic circuit struct:
The
Circuit
is a collection of gates. Since for the execution of these gates is important that these form a directed acyclic graph (DAG), the correct way of building this circuit is using theCircuitBuilder
The
CircuitBuilder
API ensures that the gates are ordered topologically, this means in the order they should be executed taking dependencies into accountHere is our only constrain for the gates, they have to implement the
Component
trait, this means that they should be able to return an iterator over the nodes.The
Node
struct:Example