Basic pretty printing of systems is confusing
In bab68fe7 a method System.__str__
was added that produces output like:
<InfiniteSystem with 4 sites, and 6 hoppings>
This feature went under my radar, but today I became aware (thanks to a confused user of Kwant) that it's problematic. What is actually shown are the values of self.graph.num_nodes
and self.graph.num_edges
. This poses several problems:
-
Hoppings of Kwant systems are by design Hermitian. In order to be able to query the hoppings of each site, each hopping is stored as a pair of edges of a directed compressed graph. Thus, what is typically understood as the number of hoppings would rather correspond to half that value.
-
The number of sites of an infinite system does not correspond to the number of sites of the graph, since the graph contains "mirror" sites that are used to define inter-cell hoppings.
Both these points seem easy to fix. But we should also consider the planned evolution of Kwant. In our new vectorized system format the number of hoppings in the old sense is not even that easy to compute (since there can be multiple hoppings connecting the same sites).
Such pretty printed "representations" of systems must be very lossy. What is actually their purpose? To provide some useful statistics? To be able to tell different systems from each other? Something else?