DEV Community

Aanha Islam
Aanha Islam

Posted on

Ask the Circuit and Exact Dicke State Preparation at DuQuantum

This is a submission for the MLH x DEV Writing Challenge

What I Built

At DuQuantum, Duke’s quantum computing hackathon, my team had 24 hours to solve a deceptively simple problem. Prepare an exact Dicke state for Google’s Willow processor, using as few gates and as little circuit depth as possible.

A Dicke state spreads a fixed number of excitations evenly across every possible arrangement of qubits. For six qubits with three excitations, that means an equal superposition of all 20 bitstrings containing exactly three ones.

Writing down that state is easy. Building an efficient circuit to prepare it under hardware constraints is where the work begins.

Our main project was a circuit preparation function, create_dicke_state_adaptive, built using CZ and single qubit gates. It had to respect the processor’s connectivity and stay within a 1750 moment limit. The challenge evaluated our circuits using real hardware calibration data, so gate errors and routing costs directly affected how well an approach performed. You can explore our code on GitHub https://github.com/tanishsinghrajpal1029/Team-Popeyes-DuHack-GoogleQAI and visit the website we built https://tanishsinghrajpal.com/team-popeyes-hackduke-website to learn more about the project.

Exactness was the first hurdle. A circuit that failed to prepare the target state scored zero. Once an approach passed that check, we worked on reducing its cost. Our six qubit, three excitation baseline used 52 CZ gates, giving us a concrete starting point for exploring shorter constructions and better routing.

Alongside the main project, I built Ask the Circuit using the Gemini API. It connected natural language questions to our circuit metrics, giving us another way to explore the circuits we were developing.

Our team placed 3rd in the Google Quantum AI Challenge Standard Track, and Ask the Circuit won MLH Best Use of Gemini API.

Demo

The main project takes a qubit count and an excitation count and constructs a circuit for the corresponding Dicke state. Its output can then be checked against the exact target and evaluated for gate count, depth, and compatibility with the hardware.

For a six qubit state with three excitations, an ideal measurement should always return a bitstring with exactly three ones, with all 20 valid arrangements equally likely. Noise can disturb that distribution and produce outcomes with the wrong number of ones. This makes the purpose of our optimization tangible. A shorter circuit gives noise fewer opportunities to disrupt the preparation.

Ask the Circuit adds a conversational way to inspect the circuit metrics produced by our code.

Partner Technologies

Our main project centered on the Google Quantum AI challenge and its Willow hardware constraints. We designed with CZ and single qubit gates, accounted for connectivity when routing operations, and compared approaches using the supplied hardware calibration data.

That changed what counted as an improvement. A construction could look efficient before routing but become expensive once its operations had to fit the available connections. We had to consider the circuit as it would actually be executed, including the extra depth and gates introduced along the way.

I also used the Gemini API to build Ask the Circuit end to end. Through a Python tool, it connected questions about circuit metrics to our create_dicke_state_adaptive workflow, which included validation against the exact target state.

Working with Gemini in this setting meant grounding the answers in computed results. The API made the circuit easier to query, while our code supplied the metrics and checked correctness. Building that connection was what made the tool useful within the larger project.

Hackathon Experience

I teamed up with Tanish, Bryan, and Richard. The four of us worked in one repository on separate branches, trying different approaches and comparing what each produced.

That gave us a productive rhythm. Someone would find a promising construction, another person would test a different approach, and the results would give us a new direction to investigate. Comparing implementations helped us catch mistakes and identify improvements we might have missed working alone.

My research focuses on quantum error correction, where the cost of reliable computation is a central concern. At DuQuantum, I approached that concern through state preparation. Every gate we could remove while preserving the exact state was one less opportunity for error.

The lesson that stayed with me was how closely experimentation and verification had to work together. We could try ambitious ideas, but every change still had to prepare the correct state and demonstrate a measurable benefit.

Finishing 3rd in the Google Quantum AI Challenge Standard Track was a shared achievement. Winning MLH Best Use of Gemini API for Ask the Circuit made the weekend even more meaningful to me. I left wanting to explore larger Dicke states and keep developing tools that help us understand and improve the circuits behind them.

Top comments (0)