Layout.combine_into_edge_map

Layout.combine_into_edge_map(another_layout)[source]

Combines self and another_layout into an “edge map”.

For example:

   self       another_layout  resulting edge map
qr_1 -> 0        0 <- q_2         qr_1 -> q_2
qr_2 -> 2        2 <- q_1         qr_2 -> q_1
qr_3 -> 3        3 <- q_0         qr_3 -> q_0

The edge map is used to compose dags via, for example, compose.

Parameters

another_layout (Layout) – The other layout to combine.

Returns

A “edge map”.

Return type

dict

Raises

LayoutError – another_layout can be bigger than self, but not smaller. Otherwise, raises.