This program is part of QOBLIB - Quantum Optimization Benchmarking Library and is used to evaluate and verify solutions for the Low Autocorrelation Binary Sequence (LABS) problem.
It computes the energy of a given binary sequence and checks whether the solution is known to be optimal (for small instances).
Given a sequence
and the energy of a sequence as
The goal is to find the sequence of minimum energy given its length
Given a binary solution and a sequence length k, this checker:
- Parses the solution in various formats.
- Converts it to a ±1 vector.
- Computes the energy of the sequence.
- Prints a compact run-length encoding (LL code) of the sequence.
- Compares energy to known optimal values (for small
k).
This program does not check for optimality.
The checker automatically detects these formats:
010011001101...
Or with separators:
0,1,0,0,1,1,...
Each line contains a variable index (1-based) to be interpreted as 0 (i.e., -1):
3
7
9
...
All others are assumed to be 1 (i.e., +1).
x#1 1
x#2 0
x#3 1
...
Lines not starting with x# are ignored.
First, build the checker using Cargo:
cargo build --release./target/release/check_labs <k> <solution-file | 01-string | LL-string>k: Length of the binary sequence.solution: Can be a file or an inline string.
From a file:
./target/release/check_labs 32 my_solution.txt./target/release/check_labs 32 01010100101101111101The output looks like:
QOBLIB LABS Solution Checker Version 1.0
LABS k=32 E(S)=64 seq=71112111133221221 optimal
Where:
E(S)is the computed energy.seqis a compact run-length code.optimalindicates a known best solution (for small k).failureindicates suboptimal energy.
If the instance is too large to verify against known values:
LABS k=55 E(S)=321 seq=6c3b4b4d4b4d4b5 too big to check
- 0: Solution is valid
- 1: Solution fails validation
- 2: Error (e.g., file not found, parsing error)
Part of QOBLIB, released under Apache 2.0.
Thorsten Koch © 2025