Add __str__ to ClusterExpansion
Description
As a user, I want to be able to query the status of a cluster expansion directly via
ce = ClusterExpansion.read('myfile')
print(ce)
This should provide some kind of overview akin to the __str__
/__repr__
function in ClusterSpace
but include the effective cluster interactions (ECIs), approximately
========================= Cluster Expansion ==================================
subelements: V Pd
cutoffs: [7.9421]
total number of orbits: 10
number of orbits by order: 0= 1 1= 1 2= 8
------------------------------------------------------------------------------
index | order | size | multiplicity | orbit index | MC vector | ECI
------------------------------------------------------------------------------
0 | 0 | 0.0000 | 1 | -1 | . | 250.0
1 | 1 | 0.0000 | 1 | 0 | [0] | 0.1
2 | 2 | 1.4040 | 6 | 1 | [0, 0] | 75.1
3 | 2 | 1.9855 | 3 | 2 | [0, 0] | -5.0
4 | 2 | 2.4317 | 12 | 3 | [0, 0] | 1.0
5 | 2 | 2.8079 | 6 | 4 | [0, 0] | 0.5
6 | 2 | 3.1393 | 12 | 5 | [0, 0] | 0.1
7 | 2 | 3.4390 | 4 | 6 | [0, 0] | 0.0
8 | 2 | 3.7145 | 24 | 7 | [0, 0] | 0.0
9 | 2 | 3.9710 | 3 | 8 | [0, 0] | 0.0
==============================================================================
Demonstration
- unit test of
ClusterExpansion
updated - all tests pass
- add snippet in user guide that illustrates the functionality
Edited by Paul Erhart