test_labeling
- Model.test_labeling(output='print', return_type='dict', plot_type='combined', overlap_threshold=None, overlaps='relevant', decimals=3)
Inspect eigenstate labeling quality in the local-\(S_z\) product basis.
Computes
np.abs(model.eigenbasis)**2row-wise and reports overlaps with local-\(S_z\) product-basis states for each eigenstate. Whenoverlap_thresholdis provided, only eigenstates below that diagonal overlap are included.- Parameters:
output (
str) – Output mode.'return'returns data,'print'prints a formatted dict-style report, and'plot'visualizes the overlap matrix.return_type (
str) – Return payload used whenoutput='return'.'dict'returns structured overlap data and'matrix'returns the overlap matrix as a plainnumpy.ndarray.plot_type (
str) – Plot style used whenoutput='plot'.'combined'uses a shared grayscale colormap.'diag_offdiag_separate'colors diagonal and off-diagonal overlaps separately and uses independent scales.overlap_threshold (
float|None) – Optional dominant local-\(S_z\) product-basis overlap threshold.Nonereports all eigenstates.overlaps (
str|int) – Overlap selection used inreturn_type='dict'andoutput='print'mode.'all'keeps all overlaps, an integer keeps the largestnoverlaps, and'relevant'keeps the smallest prefix whose cumulative overlap reaches0.99.decimals (
int) – Number of digits printed after the decimal point for overlaps.
- Return type:
- Returns:
If
output='return'andreturn_type='dict', returns a list sorted by increasing diagonal overlap. Each entry containseigenstateandoverlaps. Theoverlapsvalue is a list of dictionaries withproduct_stateandoverlapkeys, sorted by decreasing overlap. Ifreturn_type='matrix', returns the overlap matrix as anumpy.ndarray. Otherwise returnsNone.