QFC (Quantum FPGA Compiler) is a framework that compiles VHDL hardware descriptions into quantum circuits (QASM) that can run on quantum simulators or real quantum hardware.
- Learn quantum computing through familiar VHDL syntax
- Experiment with quantum implementations of classical circuits
- Research quantum computing applications
- Prototype hardware designs on quantum platforms
- Explore the intersection of classical and quantum computing
No, QFC is currently in Alpha stage. It's great for:
- Learning and experimentation
- Research projects
- Prototyping
- Educational purposes
Not recommended for:
- Production systems
- Critical applications
- Large-scale deployments
MIT License - free to use, modify, and distribute.
- Python 3.8 or higher
- 2GB RAM minimum (4GB recommended)
- 500MB disk space
- Windows 10+, Linux, or macOS
- Internet connection (for IBM Quantum)
pip install -r requirements.txt
python verify_install.pySee INSTALL.md for details.
No! QFC includes a local quantum simulator (Qiskit Aer) that runs on your regular computer. IBM Quantum access is optional.
- Go to https://quantum-computing.ibm.com/
- Create a free account
- Navigate to Account Settings
- Copy your API token
Currently supported:
- Entity declarations
- Port declarations (in/out)
- Architecture bodies
- Signal declarations
- Logic gates: AND, OR, NOT, XOR, NAND, NOR, XNOR
- Simple assignments
Coming soon:
- State machines
- Arithmetic operations
- Vectors/arrays
- Processes
- Conditional statements
Common issues:
- Unsupported features - Check supported subset
- Syntax errors - Verify VHDL syntax
- Missing declarations - Ensure all signals declared
- Entity/architecture mismatch - Names must match
See examples/ for reference implementations.
Not yet - currently only single-bit std_logic is supported. Vector support is planned for the next release.
- Use
--verboseflag for details - Check examples/ for reference
- Start with simple gates
- Add complexity incrementally
- Verify VHDL syntax
Qiskit Aer (Simulator):
- Runs locally on your computer
- Fast execution (seconds)
- No queue times
- Perfect for testing
- Free
IBM Quantum (Hardware):
- Runs on real quantum computers
- Slower (minutes to hours)
- Queue times vary
- Subject to noise/errors
- Free tier available
Quantum circuits are probabilistic. Multiple measurements give statistical results. For classical logic gates, one state should dominate (>99%).
Shots = number of times to run the circuit. More shots = better statistics.
- Testing: 1024 shots
- Accuracy: 2048-4096 shots
- Research: 8192+ shots
On simulator: Should be perfect. Check circuit.
On real hardware:
- Quantum computers have noise
- Decoherence affects results
- Error rates vary by device
- This is normal for current quantum hardware
Each VHDL signal requires one qubit:
- AND gate: 3 qubits (2 inputs + 1 output)
- Half adder: 4 qubits (2 inputs + 2 outputs)
- Full adder: 7 qubits (3 inputs + 2 outputs + 2 internal)
Current quantum computers: 5-100 qubits available.
python qfc.py compile input.vhdlSee USAGE.md for all options.
python qfc.py run circuit.qasm --backend aerYes!
python qfc.py visualize circuit.qasm.\build.bat # Windows
./build.sh # LinuxExecutable will be in dist/ directory.
Yes! QFC can run any OpenQASM 2.0 file:
python qfc.py run my_custom_circuit.qasm| Classical | Quantum |
|---|---|
| AND | Toffoli (CCX) |
| OR | NOT-AND-NOT |
| NOT | X + CNOT |
| XOR | CNOT |
See ARCHITECTURE.md for details.
This is primarily for:
- Education: Learn quantum through familiar concepts
- Research: Explore quantum implementations
- Experimentation: Test quantum approaches
- Future: Prepare for quantum-classical hybrid systems
Compilation: Fast (milliseconds) Simulation: Fast (seconds) Real hardware: Slow (minutes to hours due to queue)
Yes! QFC is open source. See compiler/ and runner/ directories. Contributions welcome!
- Modify
compiler/parser.pyfor new syntax - Update
compiler/ir.pyfor new operations - Add quantum mapping in
compiler/translator.py - Test with examples
pip install -r requirements.txt --upgradeCheck VHDL syntax. Must have:
entity NAME is
port (...);
end NAME;For IBM backend:
- Check internet connection
- Verify token is valid
- Try Aer backend first
pip install pyinstaller --upgrade
python build.py --cleanSimulator: Should be perfect - check circuit logic
Hardware: Noise is normal - use more shots for better statistics
Reduce complexity:
- Use fewer signals
- Simplify operations
- Break into smaller circuits
Planned for next major release (Q2 2025).
Yes! RISC-V and ARM support is on the roadmap (Q2-Q3 2025).
Currently Qiskit only. Support for Cirq, Q#, and Braket is planned (Q3 2025).
IDE integration and web interface are planned for future releases.
Yes! Contributions welcome. Areas needed:
- Extended VHDL parsing
- Optimization algorithms
- Additional backends
- Documentation
- Examples
- Begin with simple gates (AND, OR, NOT)
- Test each component individually
- Use verbose mode for debugging
- Visualize circuits before running
- Start with simulator, then try hardware
# 1. Write/modify VHDL
# 2. Compile
python qfc.py compile circuit.vhdl --verbose
# 3. Visualize
python qfc.py visualize circuit.qasm
# 4. Test on simulator
python qfc.py run circuit.qasm --backend aer
# 5. (Optional) Run on hardware
python qfc.py run circuit.qasm --backend ibm --token TOKEN- Compare with expected truth table
- Use high shot count (4096+)
- Test on simulator first
- Check dominant state percentage
- Run multiple times for consistency
In examples/ directory:
- and_gate.vhdl
- or_gate.vhdl
- xor_gate.vhdl
- not_gate.vhdl
- half_adder.vhdl
- full_adder.vhdl
- Run
python demo.py - Read GET_STARTED.md
- Try all examples
- Read ARCHITECTURE.md
- Experiment with your own designs
Documentation includes:
- QUICKSTART.md - 5 minutes
- GET_STARTED.md - Detailed guide
- examples/README.md - Example walkthrough
- demo.py - Interactive demo
- Read documentation in docs/
- Check examples/
- Run
python qfc.py --help - Review ARCHITECTURE.md
Quantum FPGA Compiler
Created as an experimental framework to bridge classical hardware design and quantum computing.
Yes! QFC is MIT licensed. Please cite appropriately if used in publications.
No, QFC is independent. It uses IBM's Qiskit framework and can access IBM Quantum hardware, but is not officially affiliated.
Check STATUS.md for current status and roadmap.
Still have questions?
- Check INDEX.md for all documentation
- Read ARCHITECTURE.md for technical details
- Run
python qfc.py --helpfor command help - Explore examples/ for practical examples