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 variablevariable.- Parameters:
variable (str) – the name of the variable of the variants.
**run – the arguments of
comnum.Chain.run().
- Returns:
the results of every chain, the variant first in the conditions.
- Return type:
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']