minorminer
minorminer copied to clipboard
Compare division by zero strategies
Division by zero is unavoidable in a vectorized implementation of p_norm
since zeros appear along the diagonal of the matrix. There are (at least) two strategies to overcome this:
- Catch the
numpy
division by zero errors and convert the output tonan
. - Add some small epsilon along the diagonal so that we no longer have zeros.
Strategy 1. is currently implemented. https://github.com/dwavesystems/minorminer/blob/3c0331f95b64c9513f76ad95e686ea05391ea6f4/minorminer/layout/layout.py#L125 We should compare run-time differences and layout quality differences between the two strategies.