Composition Patterns#

psipose follows a “composition over inheritance” design. Components can be mixed and matched independently.

Example: Custom Encoder + Ansatz#

from psipose.encoders import AngleEncoder
from psipose.ansatze import StronglyEntanglingAnsatz
from psipose.estimators import VQCClassifier

clf = VQCClassifier(
    encoder=AngleEncoder(rotation="X"),
    ansatz=StronglyEntanglingAnsatz(layers=3),
    n_qubits=4,
    n_iter=200
)
clf.fit(X, y)