LightsOut Decoder¶
QECC provides means to decode quantum codes based on an analogy to the well-known LightsOut puzzle.
The main class for the decoder is the LightsOut
class.
- class LightsOut(lights_to_switches, switches_to_lights, switch_vars=None, helper_vars=<factory>, optimizer=<factory>)[source]¶
Lights out problem representation.
- complete_parity_constraint(light, indices, val)[source]¶
Completes the parity constraints for a light.
Adds the constraint that is dependent on the value of the light.
- Return type:
- preconstruct_parity_constraint(light, indices)[source]¶
Preconstruct the parity constraints for a light.
Adds all constraint to the optimizer that are independent of the value of the light.
- Return type:
- preconstruct_z3_instance()[source]¶
Preconstruct the z3 instance for the lights-out problem.
Creates all necessary variables, adds the known parts of the parity constraints. Soft constraints are added to the optimizer with default weights.
- Return type:
The main function for the decoder is the run()
function.