This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% [markdown] | |
# Implementing Two's complements subtractor using quantum gates. | |
# %% | |
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, Aer, execute | |
# %% | |
simulator = Aer.backends('qasm_simulator')[0] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, Aer, execute | |
# %% | |
simulator = Aer.backends('statevector_simulator')[0] | |
# %% | |
def Full_Adder(circuit, a, b, c, d): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyaudio | |
import socket | |
import pickle | |
audio = pyaudio.PyAudio() | |
stream = audio.open(format=pyaudio.paInt16, channels=2, rate=44100, output=True, frames_per_buffer=1024) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(("192.168.48.128", 5000)) | |
data = s.recv(1024) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
s.connect((socket.gethostname(),1234)) | |
msg = s.recv(1024) | |
print("File received.") | |
filename = input("Save file as:") | |
filetoWrite = open(file=filename,mode="wb") | |
filetoWrite.write(msg) | |
filetoWrite.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import select | |
import sys | |
import uuid | |
mac_add = (':'.join(['{:02x}'.format((uuid.getnode() >> ele) & 0xff) for ele in range(0,8*6,8)][::-1])) | |
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
IP_address = "192.168.48.128" | |
Port = 20001 |