dwavesystems / dwavesystems/dwave-system

chain_break_fraction result seems strange

Open
#237 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
98
Forks
67
Avg merge
7m
Merged PRs (30d)
1

Description

**Description**
I see `chain_break_fraction` defined as `vectors['chain_break_fraction'] = broken_chains(target_sampleset, chains).mean(axis=1)[idxs]` where `broken_chains` is an array of T/F, so my expectation is that if a sample has n chains that `chain_break_fraction` can have values of `[i/n for i in range(n+1)]`.

In the example below I have 5 chains, so I'd understand values [0.0, 0.2, 0.4, 0.6, 0.8, 1.0] , but where does 0.09090909 come from?

```
SampleSet(rec.array([([1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0], -2., 420, 0.09090909),
([0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0], -2., 475, 0.09090909),
([1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], -2., 2, 0. ),
([1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1], -2., 6, 0. ),
([1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1], -2., 1, 0. ),
([1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], -2., 12, 0. ),
([0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], -2., 16, 0. ),
([1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0], -2., 4, 0. ),
([1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0], -2., 14, 0. ),
([0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0], -2., 7, 0. ),
([0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0], -2., 19, 0. ),
([1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0], -2., 2, 0. ),
([0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0], -2., 1, 0. ),
([0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0], -2., 8, 0. ),
([0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0], -2., 4, 0. ),
([0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1], -2., 8, 0. ),
([1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], -2., 1, 0.09090909)],
dtype=[('sample', 'i1', (11,)), ('energy', '

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.