Skip to content

feat(circuits): add 3-qubit gates (Toffoli, Fredkin) #28

Description

@ddri

The current gate set is limited to 1-qubit and 2-qubit gates. Missing:

  • Toffoli (CCX) — controlled-controlled-NOT. Used in quantum arithmetic, Grover's algorithm oracles, and some error correction schemes.
  • Fredkin (CSWAP) — controlled-SWAP. Used in quantum multiplexers and some quantum ML circuits.

Implementation notes

  • Add ccx(control1, control2, target) and cswap(control, target0, target1) methods to Circuit in marqov/circuits.py
  • Add to the gate map in each converter: to_braket(), to_qiskit(), to_cirq(), to_openqasm()
  • Add to each importer: from_braket(), from_qiskit(), from_cirq(), from_openqasm()
  • Add tests in tests/test_circuits.py — gate application, roundtrip conversion for each framework
  • Update the canonical gate set table in CONTRIBUTING.md §1

References

  • Qiskit: CCXGate, CSwapGate
  • Braket: CCNot, CSwap
  • Cirq: CCNOT, CSWAP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions