Noisy Simulation
QPyth includes a proprietary offline noise simulation engine powered by historical IBM Quantum device calibration data. This enables realistic testing of quantum algorithms without requiring access to actual hardware.
Overview
Quantum computers are subject to various sources of noise: - Decoherence - Loss of quantum coherence over time (T1, T2) - Gate errors - Imperfect quantum gate operations - Readout errors - Measurement inaccuracies - Crosstalk - Unwanted interactions between qubits
QPyth's noisy simulation models these effects using real calibration data from IBM Quantum devices.
Available Noise Profiles
QPyth includes noise profiles from 10 IBM Quantum backends:
127-Qubit Processors
ibm_brisbane- Eagle r3 processoribm_sherbrooke- Eagle r3 processoribm_kyoto- Eagle r3 processoribm_osaka- Eagle r3 processoribm_perth- Eagle r3 processoribm_quebec- Eagle r3 processor
27-Qubit Processors
ibm_hanoi- Falcon r5.11H processoribm_cusco- Falcon r5.11H processoribm_algiers- Falcon r5.11H processoribm_toronto- Falcon r5.11H processor
Each profile includes: - Average T1 (relaxation) times - Average T2 (dephasing) times - Readout error rates - Single-qubit gate errors - Two-qubit gate errors - Qubit connectivity
Basic Usage
CLI
Python API
from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine
# Create noisy simulator with IBM calibration profile
engine = NoisySimulatorEngine(noise_profile="ibm_brisbane")
# Run circuit with noise
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
result = engine.run(qc, shots=1024)
print(f"Counts: {result['counts']}")
Web UI
- Start the web UI (see Web UI)
- Navigate to the VQE tab
- Select "Noisy Simulator" execution mode
- Choose a noise profile
- Run simulation
Noise Profile Information
Get detailed information about a noise profile:
from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine
engine = NoisySimulatorEngine(noise_profile="ibm_brisbane")
info = engine.get_profile_info()
print(f"Backend: {info['name']}")
print(f"Qubits: {info['num_qubits']}")
print(f"Avg T1: {info['avg_t1_us']} μs")
print(f"Avg T2: {info['avg_t2_us']} μs")
print(f"Avg Readout Error: {info['avg_readout_error'] * 100:.3f}%")
Available Profiles
List all available noise profiles:
from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine
engine = NoisySimulatorEngine()
profiles = engine.get_available_profiles()
for profile in profiles:
print(profile)
Noise Model Construction
QPyth automatically constructs noise models from calibration data:
from quantumpytho.modules.noise_builder import (
parse_calibration_csv,
build_noise_model_from_profile
)
# Parse calibration CSV
profile = parse_calibration_csv("ibm_brisbane")
# Build noise model
noise_model = build_noise_model_from_profile(profile)
# Use with Qiskit Aer
from qiskit_aer import AerSimulator
simulator = AerSimulator(noise_model=noise_model)
Custom Noise Models
Create custom noise models:
from qiskit_aer.noise import NoiseModel, errors
# Create noise model
noise_model = NoiseModel()
# Add depolarizing error
error = errors.depolarizing_error(0.001, 1)
noise_model.add_all_qubit_quantum_error(error, ['h', 'x', 'y', 'z'])
# Add readout error
readout_error = errors.readout_error([[0.99, 0.01], [0.02, 0.98]])
noise_model.add_all_qubit_readout_error(readout_error)
# Use with simulator
from qiskit_aer import AerSimulator
simulator = AerSimulator(noise_model=noise_model)
Comparing Ideal vs Noisy
Compare ideal and noisy simulations:
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine
# Create circuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
# Ideal simulation
ideal_sim = AerSimulator()
ideal_result = ideal_sim.run(qc, shots=1024).result()
ideal_counts = ideal_result.get_counts()
# Noisy simulation
noisy_engine = NoisySimulatorEngine(noise_profile="ibm_brisbane")
noisy_result = noisy_engine.run(qc, shots=1024)
noisy_counts = noisy_result['counts']
print(f"Ideal counts: {ideal_counts}")
print(f"Noisy counts: {noisy_counts}")
VQE with Noise
Run VQE with realistic noise:
from quantumpytho.config import ExecutionMode, QuantumConfig
from quantumpytho.modules.vqe_h2_cli import run_vqe_h2_cli
# Configure noisy simulation
config = QuantumConfig(
mode=ExecutionMode.NOISY_SIMULATOR,
noise_profile="ibm_brisbane"
)
# Run VQE with noise
run_vqe_h2_cli(config=config)
Performance Considerations
Trade-offs
- Accuracy vs Speed - More accurate noise models are slower
- Profile Selection - Choose profile matching your target hardware
- Shots - More shots improve statistics but increase runtime
Optimization Tips
- Use appropriate profile - Match profile to your target hardware
- Optimize circuit depth - Deeper circuits accumulate more noise
- Use error mitigation - Apply error mitigation techniques
- Benchmark first - Test with small circuits before scaling up
Error Mitigation
QPyth supports basic error mitigation:
from qiskit_aer.noise import NoiseModel
from qiskit_aer import AerSimulator
from qiskit.visualization import plot_histogram
# Create noise model
noise_model = NoiseModel.from_backend("ibm_brisbane")
# Enable measurement error mitigation
simulator = AerSimulator(
noise_model=noise_model,
mitigation_config={
"measure_mitigation": True
}
)
# Run with mitigation
result = simulator.run(qc, shots=1024).result()
mitigated_counts = result.get_counts()
Troubleshooting
Profile Not Found
Check available profiles:
from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine
engine = NoisySimulatorEngine()
print(engine.get_available_profiles())
Import Errors
Ensure Qiskit Aer is installed:
Performance Issues
- Reduce number of shots
- Use simpler noise models
- Optimize circuit depth
- Use ideal simulator for testing