Skip to content

Latest commit

 

History

History
401 lines (272 loc) · 8.93 KB

File metadata and controls

401 lines (272 loc) · 8.93 KB

Frequently Asked Questions (FAQ)

General Questions

What is QFC?

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.

Why would I use this?

  • 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

Is this production-ready?

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

What license is QFC under?

MIT License - free to use, modify, and distribute.

Installation & Setup

What are the system requirements?

  • Python 3.8 or higher
  • 2GB RAM minimum (4GB recommended)
  • 500MB disk space
  • Windows 10+, Linux, or macOS
  • Internet connection (for IBM Quantum)

How do I install QFC?

pip install -r requirements.txt
python verify_install.py

See INSTALL.md for details.

Do I need a quantum computer?

No! QFC includes a local quantum simulator (Qiskit Aer) that runs on your regular computer. IBM Quantum access is optional.

How do I get an IBM Quantum token?

  1. Go to https://quantum-computing.ibm.com/
  2. Create a free account
  3. Navigate to Account Settings
  4. Copy your API token

VHDL & Compilation

What VHDL features are supported?

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

Why doesn't my VHDL compile?

Common issues:

  1. Unsupported features - Check supported subset
  2. Syntax errors - Verify VHDL syntax
  3. Missing declarations - Ensure all signals declared
  4. Entity/architecture mismatch - Names must match

See examples/ for reference implementations.

Can I use std_logic_vector?

Not yet - currently only single-bit std_logic is supported. Vector support is planned for the next release.

How do I debug compilation errors?

  1. Use --verbose flag for details
  2. Check examples/ for reference
  3. Start with simple gates
  4. Add complexity incrementally
  5. Verify VHDL syntax

Quantum Execution

What's the difference between Aer and IBM backends?

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

Why do I get multiple results?

Quantum circuits are probabilistic. Multiple measurements give statistical results. For classical logic gates, one state should dominate (>99%).

What are "shots"?

Shots = number of times to run the circuit. More shots = better statistics.

  • Testing: 1024 shots
  • Accuracy: 2048-4096 shots
  • Research: 8192+ shots

Why are my results noisy?

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

How many qubits do I need?

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.

Usage & Commands

How do I compile VHDL?

python qfc.py compile input.vhdl

See USAGE.md for all options.

How do I run QASM?

python qfc.py run circuit.qasm --backend aer

Can I visualize circuits?

Yes!

python qfc.py visualize circuit.qasm

How do I build an executable?

.\build.bat          # Windows
./build.sh           # Linux

Executable will be in dist/ directory.

Can I run QASM files directly?

Yes! QFC can run any OpenQASM 2.0 file:

python qfc.py run my_custom_circuit.qasm

Technical Questions

How are classical gates mapped to quantum gates?

Classical Quantum
AND Toffoli (CCX)
OR NOT-AND-NOT
NOT X + CNOT
XOR CNOT

See ARCHITECTURE.md for details.

Why use quantum for classical circuits?

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

What's the performance like?

Compilation: Fast (milliseconds) Simulation: Fast (seconds) Real hardware: Slow (minutes to hours due to queue)

Can I add new features?

Yes! QFC is open source. See compiler/ and runner/ directories. Contributions welcome!

How do I extend VHDL support?

  1. Modify compiler/parser.py for new syntax
  2. Update compiler/ir.py for new operations
  3. Add quantum mapping in compiler/translator.py
  4. Test with examples

Troubleshooting

"Module not found" error

pip install -r requirements.txt --upgrade

"No entity declaration found"

Check VHDL syntax. Must have:

entity NAME is
    port (...);
end NAME;

"Backend not available"

For IBM backend:

  • Check internet connection
  • Verify token is valid
  • Try Aer backend first

Build fails with PyInstaller

pip install pyinstaller --upgrade
python build.py --clean

Results don't match expected

Simulator: Should be perfect - check circuit logic

Hardware: Noise is normal - use more shots for better statistics

Circuit is too large

Reduce complexity:

  • Use fewer signals
  • Simplify operations
  • Break into smaller circuits

Future Plans

When will vectors be supported?

Planned for next major release (Q2 2025).

Will you support RISC-V?

Yes! RISC-V and ARM support is on the roadmap (Q2-Q3 2025).

Can I use other quantum frameworks?

Currently Qiskit only. Support for Cirq, Q#, and Braket is planned (Q3 2025).

Will there be a GUI?

IDE integration and web interface are planned for future releases.

Can I contribute?

Yes! Contributions welcome. Areas needed:

  • Extended VHDL parsing
  • Optimization algorithms
  • Additional backends
  • Documentation
  • Examples

Best Practices

How should I start?

  1. Begin with simple gates (AND, OR, NOT)
  2. Test each component individually
  3. Use verbose mode for debugging
  4. Visualize circuits before running
  5. Start with simulator, then try hardware

What's a good workflow?

# 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

How do I verify results?

  1. Compare with expected truth table
  2. Use high shot count (4096+)
  3. Test on simulator first
  4. Check dominant state percentage
  5. Run multiple times for consistency

Examples & Learning

Where are the examples?

In examples/ directory:

  • and_gate.vhdl
  • or_gate.vhdl
  • xor_gate.vhdl
  • not_gate.vhdl
  • half_adder.vhdl
  • full_adder.vhdl

How do I learn more?

  1. Run python demo.py
  2. Read GET_STARTED.md
  3. Try all examples
  4. Read ARCHITECTURE.md
  5. Experiment with your own designs

Are there tutorials?

Documentation includes:

Where can I get help?

  1. Read documentation in docs/
  2. Check examples/
  3. Run python qfc.py --help
  4. Review ARCHITECTURE.md

Miscellaneous

What does QFC stand for?

Quantum FPGA Compiler

Who created QFC?

Created as an experimental framework to bridge classical hardware design and quantum computing.

Can I use this for my research?

Yes! QFC is MIT licensed. Please cite appropriately if used in publications.

Is QFC affiliated with IBM?

No, QFC is independent. It uses IBM's Qiskit framework and can access IBM Quantum hardware, but is not officially affiliated.

How can I stay updated?

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 --help for command help
  • Explore examples/ for practical examples