mirror of https://github.com/Qiskit/qiskit.git
modified reps for ZZFeatureMap object created, to fit printed circuit (#8333)
* modified reps for ZZFeatureMap object created, to fit printed circuit * updated the output of classifier.parameters for Example 2
This commit is contained in:
parent
81abc384e4
commit
400fadf70e
|
@ -37,7 +37,8 @@ class ZZFeatureMap(PauliFeatureMap):
|
|||
|
||||
Examples:
|
||||
|
||||
>>> prep = ZZFeatureMap(2, reps=2)
|
||||
>>> from qiskit.circuit.library import ZZFeatureMap
|
||||
>>> prep = ZZFeatureMap(2, reps=1)
|
||||
>>> print(prep)
|
||||
┌───┐┌──────────────┐
|
||||
q_0: ┤ H ├┤ U1(2.0*x[0]) ├──■───────────────────────────────────────■──
|
||||
|
@ -50,11 +51,24 @@ class ZZFeatureMap(PauliFeatureMap):
|
|||
>>> classifier.num_parameters
|
||||
15
|
||||
>>> classifier.parameters # 'x' for the data preparation, 'θ' for the SU2 parameters
|
||||
{Parameter(θ[9]), Parameter(θ[4]), Parameter(θ[6]), Parameter(θ[1]), Parameter(x[2]),
|
||||
Parameter(θ[7]), Parameter(x[1]), Parameter(θ[8]), Parameter(θ[2]), Parameter(θ[10]),
|
||||
Parameter(θ[5]), Parameter(θ[0]), Parameter(θ[3]), Parameter(x[0]), Parameter(θ[11])}
|
||||
ParameterView([
|
||||
ParameterVectorElement(x[0]), ParameterVectorElement(x[1]),
|
||||
ParameterVectorElement(x[2]), ParameterVectorElement(θ[0]),
|
||||
ParameterVectorElement(θ[1]), ParameterVectorElement(θ[2]),
|
||||
ParameterVectorElement(θ[3]), ParameterVectorElement(θ[4]),
|
||||
ParameterVectorElement(θ[5]), ParameterVectorElement(θ[6]),
|
||||
ParameterVectorElement(θ[7]), ParameterVectorElement(θ[8]),
|
||||
ParameterVectorElement(θ[9]), ParameterVectorElement(θ[10]),
|
||||
ParameterVectorElement(θ[11]), ParameterVectorElement(θ[12]),
|
||||
ParameterVectorElement(θ[13]), ParameterVectorElement(θ[14]),
|
||||
ParameterVectorElement(θ[15]), ParameterVectorElement(θ[16]),
|
||||
ParameterVectorElement(θ[17]), ParameterVectorElement(θ[18]),
|
||||
ParameterVectorElement(θ[19]), ParameterVectorElement(θ[20]),
|
||||
ParameterVectorElement(θ[21]), ParameterVectorElement(θ[22]),
|
||||
ParameterVectorElement(θ[23])
|
||||
])
|
||||
>>> classifier.count_ops()
|
||||
OrderedDict([('u1', 12), ('cx', 12), ('ry', 12), ('cz', 9), ('h', 6)])
|
||||
OrderedDict([('ZZFeatureMap', 1), ('EfficientSU2', 1)])
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
|
Loading…
Reference in New Issue