Tutorials#

Find some examples on how to use pyqit here:

Variational quantum classifier

Trains a VQCClassifier on a synthetic dataset using the torch backend, plots the loss curve from history.as_dict(), then evaluates on the test split. Ends with a VQCRegressor fitting a sine curve. Start here.

Training pipeline with callbacks

Runs EarlyStopping and ModelCheckpoint together, then inspects what each one recorded: stopped_epoch, stopping_reason, best_epoch and best_path. Ends by resuming the run from last.npz with ModelCheckpoint(resume_from=...) and predicting new rows through a saved DataModule.

Diagnosing barren plateaus with PyQit

Takes a circuit at 8 qubits and 15 layers, deep enough to plateau, and shows the gradient variance collapsing below the baseline. Then runs the same check through Trainer(check_bp=True) on a circuit that trains fine, so you can see both verdicts.

Quantum pipelines

Composes two models into a QuantumPipeline with a frozen backbone and a trainable head, then builds a dense, circuit, dense network from pyqit.models.layers and trains it as one model with fit_mode="joint".