from qiskit import BasicAer
print(BasicAer.backends())

from qiskit import QuantumCircuit,BasicAer,transpile

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

backend = BasicAer.get_backend("qasm_simulator")
tqc = transpile(qc, backend)
job = backend.run(tqc, shots=1000)
result = job.result()
counts = result.get_counts(tqc)
print(counts)

from qiskit import QuantumCircuit,BasicAer,transpile

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

backend = BasicAer.get_backend("statevector_simulator")
tqc = transpile(qc, backend)
job = backend.run(tqc)
result = job.result()
statevector = result.get_statevector(tqc, 4)
print(statevector)

from qiskit import QuantumCircuit,BasicAer,transpile

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

backend = BasicAer.get_backend("unitary_simulator")
tqc = transpile(qc, backend)
job = backend.run(tqc)
result = job.result()
unitary = result.get_unitary(tqc, 4)
print(unitary)