comnum.compare#

comnum.compare(chains: Mapping[str, Any], *, variable: str = 'variant', **run: Any) → Results#

Run several chains with the same arguments of comnum.Chain.run() and gather their results, the name of every chain as the variable variable.

Parameters:
Returns:

the results of every chain, the variant first in the conditions.

Return type:

Results

Example

>>> import comnum
>>> from comnum import blocks as B
>>> base = comnum.Chain(tx=B.Source(constellation="QPSK", n_symbols=500),
...                    ch=B.Awgn(snr_db=8.0))
>>> res = comnum.compare({"8 dB": base, "4 dB": base.replace(ch=B.Awgn(snr_db=4.0))},
...                     metrics=["ser"], stop={"max_trials": 8})
>>> res.values("variant")
['8 dB', '4 dB']