tfq.util.exponential
Stay organized with collections
Save and categorize content based on your preferences.
Return a Cirq circuit with exponential operator forms.
tfq.util.exponential(
operators, coefficients=None
)
Used in the notebooks
Construct an exponential form of given operators
and coefficients
.
Operators to be exponentiated are specified in operators
as
cirq.PauliSum
or cirq.PauliString
. Parameters are given by
coefficients
.
Note that only operators whose standard representations consist of terms
which all commute can be exponentiated. This allows use of the identity
exp(A+B+...) = exp(A)exp(B)... else there would need to be automatic
handling of Trotterization and convergence, which is not supported yet.
Args |
operators
|
Python list or tuple of cirq.PauliSum or
cirq.PauliString objects to be exponentiated.
Here are simple examples.
Let q = cirq.GridQubit(0, 0)
E.g. operator = 0.5 * X(q) -> exp(-i * 0.5 * X(q))
operator = 0.5 * cirq.PauliString({q: cirq.I})
-> exp(-i * 0.5)*np.eye(2)
Be careful of the negation and the PauliString of the identity gate.
|
coefficients
|
(Optional) Python list of Python str , float or
sympy.Symbol object of parameters. Defaults to None, then all
coefficients of operators are set to 1.0.
|
Returns |
A cirq.Circuit containing exponential form of given operators
and coefficients .
|
Raises |
TypeError
|
If operators (or its terms) is/are of an invalid type.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-17 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-05-17 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-17 UTC."],[],[]]