Skip to content

Pareto fronts API

Warning

In this version of Oraqle, the API is still prone to changes. Paths and names can change between any version.

If you are using depth-aware arithmetization, you will find that the compiler does not output one arithmetic circuit. Instead, it outputs a Pareto front, which represents the best circuits that it could generate trading off two metrics: The multiplicative depth and the multiplicative size/cost. This page briefly explains the API for interfacing with these Pareto fronts.

The abstract base class

Abstract ParetoFront

ParetoFront

Bases: ABC

Abstract base class for ParetoFronts.

One objective is to minimize the multiplicative depth, while the other objective is minimizing some value, such as the multiplicative size or cost.

__init__()

Initialize an empty ParetoFront.

from_node(node, depth=None, value=None) classmethod

Initialize a ParetoFront with one node in it.

Returns:

from_leaf(leaf) classmethod

Initialize a ParetoFront with one leaf node in it.

Returns:

add(node, depth=None, value=None)

Adds the given Node to the ParetoFront by computing its multiplicative depth and value.

Alternatively, the user can supply an unchecked depth and value so that these values do not have to be (re)computed.

Returns: True if and only if the node was inserted into the ParetoFront (so it was in some way better than the current Nodes).

add_leaf(leaf)

Add a leaf node to this ParetoFront.

add_front(front)

Add all elements from front to self.

__iter__()

get_smallest_at_depth(max_depth)

Returns the circuit with the smallest value that has at most depth max_depth.

is_empty()

Returns whether the front is empty.

get_lowest_value()

Returns the value (size or cost) of the Node with the highest depth, and therefore the lowest value.

Depth-size and depth-cost fronts