Composition Patterns#

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

Example: Custom Encoder + Ansatz#

from psipose.feature_maps import AngleFeatureMap
from psipose.ansatze import StronglyEntanglingAnsatz
from psipose.estimators import VQCClassifier

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