Geomon-Joshy / n_bit_subtraction

subtraction of two n_bit numbers using Qiskit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

n_bit_subtraction

subtraction of two n_bit numbers using qiskit

This is a qiskit algoritham to subtract a decimal number from another number.
libraries needed :-

  1. python3.
  2. qiskit .
  3. qiskit.visualization.
    Two do subtraction of bits with carry the following code is used:-
  • qc.cx(i,i+1)
  • qc.cx(i+2,i+4)
  • qc.ccx(i,i+1,i+2)
  • qc.cx(i+2,i+4)
    The number of bit of the biggest number has to be given as input.
    The total number of bits used 2*n+1

About

subtraction of two n_bit numbers using Qiskit

License:GNU General Public License v3.0


Languages

Language:Python 100.0%