What it does
A Walk in Quantum Land implements a novel quantum algorithm that acts as a 256-bit hash function, designed with the following properties in mind:
- Output determinism – For any given input, the function produces the same hash output consistently, ensured by deterministic quantum gate operations and fixed measurement order.
- Preservation of entropy – By leveraging superposition and quantum entanglement, the algorithm is designed such that outputs remain uniformly distributed when inputs are uniformly sampled, promoting high entropy retention.
- Computational difficulty – The algorithm’s design prevents sub-exponential solutions by constructing the quantum circuit to emulate hard-to-invert functions, potentially incorporating elements of quantum chaotic maps or complex Hamiltonians.
- Preimage resistance – The forward path is intentionally easy, but backtracking to the original input from an output remains non-trivial due to quantum measurement irreversibility and entanglement-based scrambling.
- Collision resistance – The mapping avoids structural symmetries, making it extremely unlikely for two distinct inputs to hash to the same output.
- Computational feasibility – The algorithm restricts its circuit simulation to 20 qubits or fewer for inputs up to 256 bits, balancing quantum complexity with current practical simulation capabilities.
- Computation time – The circuit depth and gate count are optimized to keep evaluation time low, using efficient matrix exponentiation techniques within QuTiP.
- Purely quantum hashing – The algorithm uses no classical hashing at any stage; both preprocessing and output generation are fully quantum, leveraging unitary evolution and direct measurement.
We built a fully quantum hash function using controlled quantum walks on a cycle graph. The algorithm runs on an 8-qubit system: 5 qubits represent positions on a 32-node cycle, and 2 qubits for our coin operator, and 1 qubit for the message input. Each bit of the input message dynamically alters the walk through a "liveliness" parameter, introducing structured, input-dependent variability.
At each step, we apply a Grover-style coin operator to create quantum interference, then shift the walker's position based on both the coin state and the current input bit. After processing the full message, we measure the system and convert the resulting probability distribution into a deterministic bitstring hash.
Key Features Quantum Coin + Graph: Uses a 3D quantum coin and a 32-node cycle graph. Input-Controlled Evolution: Each message bit alters the walk path via jump distance (τ). Quantum Interference: A Grover diffusion operator creates complex, hard-to-reverse mixing. Deterministic Output: Same input always yields the same 256-bit hash. Avalanche effect: Small input changes produce drastically different outputs.
How we built it
We built the project using Python with the QuTiP (Quantum Toolbox in Python) library. QuTiP allowed us to define and simulate quantum circuits, state vectors, and evolution under custom operators. We built the front-end demo with Flask, HTML, CSS, and JavaScript.
Built With
- css
- flask
- html
- javascript
- python
- qiskit
- qutip
Log in or sign up for Devpost to join the conversation.