Welcome to hamnonlineng’s documentation!¶
Engineering Hamiltonians through Nonlinearities¶
Following the formalism described in “Black-box superconducting circuit quantization” http://arxiv.org/abs/1204.0587 we can expand \(\sin(\hat{a}+\hat{b}+\dots+h.c.)\) or \(\cos(\hat{a}+\hat{b}+\dots+h.c.)\) or any other nonlinear \(f(\hat{a}+\hat{b}+\dots+h.c.)\) in order to obtain non-linear terms in the Hamiltonian (a, b, and other letters represent the annihilation operators of various oscillator modes). If we drive some of the modes classically we can create any non-linear term in the effective Hamiltonian.
This module helps solve the constraint on the frequencies of the modes (both the requirement that some of the monomials in the expansion are resonant and that all the other terms in the expansion of the nonlinearity are off-resonant).
Example IPython Notebooks¶
Example 5th order Hamiltonian with integer frequencies in arbitrary units.
Example 5th order Hamiltonian with any positive-valued frequencies in arbitrary units.
Example 7th order Hamiltonian with a more complicated nonlinearity.
API Documentation¶
-
class
hamnonlineng.core.Monomial[source]¶ Bases:
objectA class representing a monomial of the type
number*operators + h.c..The h.c. part is implicit.
Operators have to be single letters. Capital letters stand for the hermitian conjugates of lower letters.
Monomial.nis the numerical factor.Monomial.sis the string of operators.>>> Monomial(1,'a')*Monomial(1,'b') 1.ab 1.aB
-
class
hamnonlineng.core.Polynomial[source]¶ Bases:
objectA class representing a sum of monomials (each monomial implicitly having its h.c.).
Polynomial.mgives the list of monomials.
-
hamnonlineng.core.detuning_of_monomial(solution, monomials, letters)[source]¶ For the frequencies given in
solutioncalculate the detuning of the Monomials given in the listmonomials.
-
hamnonlineng.core.drop_definitely_offresonant(monomials)[source]¶ From the list
monomialsfilter out Monomials that contain only annihilation or only creation operators.
-
hamnonlineng.core.drop_matching(monomials, to_drop)[source]¶ From the list
monomialsfilter out Monomials present in the listto_drop. Compare only the string part, neglect the numerical factor.
-
hamnonlineng.core.drop_single_mode(monomials)[source]¶ From the list
monomialsfilter out Monomials that contain operators for only a single mode.
-
hamnonlineng.core.filter_resonant(solution, monomials, letters)[source]¶ Return only the resonant Monomials from the list
monomialsgiven the frequencies insolution.
-
hamnonlineng.core.head_and_count(iterator)[source]¶ Print the first 10 and store the first 100000 solutions.
-
hamnonlineng.core.monomial_to_constraint(monomial, letters)[source]¶ Given a monomial return the multiplicity of each letter, counting conjugates as negatives.
-
hamnonlineng.core.monomials_to_matrix(monomials, letters)[source]¶ Run
monomial_to_constrainton each element of the listmonomialsand generate the matrix of constraints.
-
hamnonlineng.core.operator_sum(string)[source]¶ Given a string of letters return the sum of operators represented by those letters.
-
hamnonlineng.core.sin_terms(x, order)[source]¶ Given an argument return the order-th term in the sine’s expansion.
-
hamnonlineng.core.solve_constraints_gecode(resonant_monomials, off_resonant_monomials, letters, maxfreq=10, elastic=0)[source]¶ Uses
gecodeto solve the constraints.
-
hamnonlineng.core.solve_constraints_ortools(resonant_monomials, off_resonant_monomials, letters, maxfreq=10)[source]¶ Uses
ortoolsto solve the constraints.
-
hamnonlineng.core.solve_linearprog_ortools_glop(resonant_monomials, off_resonant_monomials, letters, maxfreq=10, detune=0.5)[source]¶ Uses
ortoolsto solve the linear programming problem.
-
hamnonlineng.core.solve_linearprog_pulp(resonant_monomials, off_resonant_monomials, letters, maxfreq=10, detune=0.5, distinct=True, elastic=0)[source]¶ Uses
pulpto solve the linear programming problem.