PBMBPT Diagram¶
Routines and class for Projected Bogoliubov MBPT diagrams.
-
class
adg.pbmbpt.
ProjectedBmbptDiagram
(graph, unique_id, tag, child_tag)[source]¶ Bases:
adg.bmbpt.BmbptFeynmanDiagram
Describes a PBMBPT diagram with its related properties.
-
two_or_three_body
¶ The 2 or 3-body characted of the vertices.
Type: int
-
time_tag
¶ The tag number associated to the diagram’s associated TSD.
Type: int
-
tsd_is_tree
¶ The tree or non-tree character of the associated TSD.
Type: bool
-
feynman_exp
¶ The Feynman expression associated to the diagram.
Type: str
-
diag_exp
¶ The Goldstone expression associated to the diagram.
Type: str
-
vert_exp
¶ The expression associated to the vertices.
Type: list
-
hf_type
¶ The Hartree-Fock, non-Hartree-Fock or Hartree-Fock for the energy operator only character of the graph.
Type: str
-
unique_id
¶ A unique number associated to the diagram.
Type: int
-
vertex_exchange_sym_factor
¶ Lazy-initialized symmetry factor associated to the vertex exchange, stored to avoid being computed several times.
Type: int
-
check_graph
¶ A copy of the graph that can be used for topological equivalence checks (lazy-initialized).
Type: NetworkX MultiDiGraph
-
anomalous_contractions_factor
()[source]¶ Return the factor associated with anomalous self-contractions.
Returns: The anomalous self-contractions factor. Return type: (int)
-
attribute_expressions
(time_diag)¶ Attribute the correct Feynman and Goldstone expressions.
Parameters: time_diag (TimeStructureDiagram) – The associated TSD.
-
check_graph
Return a graph that can be used for topological equivalence checks.
Lazy-initialized to reduce memory and CPU costs as this operation requires a deep copy.
Returns: The graph with doubled anomalous props. Return type: (NetworkX MultiDiGraph)
-
degrees
¶
-
diag_exp
-
equivalent_permutations
()[source]¶ Return the permutations generating equivalent diagrams.
Returns: Vertices permutations as dictionnaries. Return type: (list)
-
extract_integral
()[source]¶ Return the integral part of the Feynman expression of the diag.
Returns: The integral part of its Feynman expression. Return type: (str)
-
extract_numerator
()[source]¶ Return the numerator associated to a PBMBPT graph.
Returns: The numerator of the graph. Return type: (str)
-
feynman_exp
-
graph
¶
-
has_anom_non_selfcontracted_props
()[source]¶ Return True if the diagram has anomalous propagators.
Returns: The presence of anomalous propagators. Return type: (bool)
-
has_anom_props_linked_sign
()[source]¶ Return True if there is a minus sign associated to anom props.
Anomalous propagators departing to higher vertices introduce a sign factor if a normal propagator is going to an even higher vertex, as it departs from the canonical representation used for numerator extraction.
Returns: The presence of the sign factor. Return type: (bool)
-
has_crossing_sign
()¶ Return True for a minus sign associated with crossing propagators.
Use the fact that all lines propagate upwards and the canonical representation of the diagrams and vertices.
Returns: - Encode for the sign factor associated with crossing
- propagators.
Return type: (bool)
-
has_sign_factor
()[source]¶ Return True if a sign factor is associated to the diagram.
Wrapper allowing for easy refactoring of expression code.
Returns: The presence of a sign factor. Return type: (boolean)
-
hf_type
-
io_degrees
¶
-
max_degree
¶
-
multiplicity_symmetry_factor
()[source]¶ Return the symmetry factor associated with propagators multiplicity.
Returns: The symmetry factor associated with equivalent lines. Return type: (str)
-
symmetry_factor
()[source]¶ Return the overall symmetry factor of the diagram.
Returns: The combination of all symmetry factors. Return type: (str)
-
time_tag
-
time_tree_denominator
(time_graph)¶ Return the denominator for a time-tree graph.
Parameters: time_graph (NetworkX MultiDiGraph) – Its associated time-structure graph. Returns: The denominator of the graph. Return type: (str)
-
tsd_is_tree
-
two_or_three_body
-
unique_id
-
unsort_degrees
¶
-
unsort_io_degrees
¶
-
vert_exp
-
vertex_exchange_sym_factor
Return the symmetry factor associated with vertex exchange.
Returns: The symmetry factor for vertex exchange. Return type: (int)
-
vertex_expression
(vertex)[source]¶ Return the expression associated to a given vertex.
Parameters: vertex (int) – The vertex of interest in the graph. Returns: The LaTeX expression associated to the vertex. Return type: (str)
-
write_diag_exps
(latex_file, norder)[source]¶ Write the expressions associated to a diagram in the LaTeX file.
Parameters: - latex_file (file) – The LaTeX outputfile of the program.
- norder (int) – The order in BMBPT formalism.
-
write_graph
(latex_file, directory, write_time)[source]¶ Write the PBMBPT graph and its associated TSD to the LaTeX file.
Parameters: - latex_file (file) – The LaTeX output file of the program.
- directory (str) – The path to the result folder.
- write_time (bool) –
True
if we want informations on the associated TSDs.
-
write_section
(result, commands, section_flags)¶ Write section and subsections for BMBPT result file.
Parameters: - result (file) – The LaTeX output file of the program.
- commands (dict) – The flags associated with run management.
- section_flags (dict) – UniqueIDs of diags starting each section.
-
write_tsd_info
(diagrams_time, latex_file)¶ Write info related to the BMBPT associated TSD to the LaTeX file.
Parameters: - diagrams_time (list) – The associated TSDs.
- latex_file (file) – The LaTeX output file of the program.
-
write_vertices_values
(latex_file, mapping)¶ Write the qp energies associated to each vertex of the diag.
Parameters: - latex_file (file) – The LaTeX output file of the program.
- mapping (dict) – A mapping between the vertices in the diagram and the vertices in its euivalent TSD, since permutations between vertices are possible.
-
-
adg.pbmbpt.
equiv_generating_permutations
(graph)[source]¶ Return the list of permutations generating equivalent PBMBPT diags.
-
adg.pbmbpt.
graph
¶ The graph to be checked.
Type: Networkx MultiDiGraph
Returns: The mappings giving equivalent graphs, inc. identity. Return type: (list) -
-
adg.pbmbpt.
filter_new_diagrams
(new_diags, old_diags)[source]¶ Eliminate diagrams having a topologically equivalent diag.
- Attibutes:
- new_diags (list): The list of newly created PBMBPT diagrams. old_diags (list): The list of already checked PBMBPT diagrams.
-
adg.pbmbpt.
generate_anomalous_diags
(diag, nbody_max)[source]¶ Generate PBMBPT graphs with anomalous lines, with some redundancy.
Parameters: - diag (BmbptFeynmanDiagram) – The diagram to generate children from.
- nbody_max (int) – The maximal n-body character of a graph vertex.
Returns: The anomalous graphs generated.
Return type: (list)
-
adg.pbmbpt.
generate_combinations
(iter_list)[source]¶ Generate all possible combinations of length 1 to total.
-
adg.pbmbpt.
iter_list
¶ A list of iterable objects.
Type: list
Returns: A list with all the possible combinations of all lengths. Return type: (list) >>> print(generate_combinations([1, 2, 3])) [(1,), (1, 2), (1, 2, 3), (1, 3), (2,), (2, 3), (3,)]
-
-
adg.pbmbpt.
unique_edge_combinations
(edges, permutations)[source]¶ Return all edge combinations not producing equivalent anomalous graphs.
-
adg.pbmbpt.
edges
¶ The edges that can be modified.
Type: list
-
adg.pbmbpt.
permutations
¶ The permutation generating equivalent diagrams.
Type: list
Returns: The list of edges producing unique anomalous diagrams. Return type: (list) >>> edges = [(1, 3), (2, 3)] >>> permutations = [{1: 1, 2: 2}, {1: 2, 2: 1}] >>> print(unique_edge_combinations(edges, permutations)) [((1, 3), (2, 3)), ((2, 3),)]
-
-
adg.pbmbpt.
unique_vertex_combinations
(vertices, permutations)[source]¶ Return vertex combinations generating unique anomalous diagrams.
Return combinations of vertices on which self-contractions can be added without producing topologically equivalent PBMBPT diagrams.
-
adg.pbmbpt.
vertices
¶ Vertices that can be self-contracted.
Type: list
-
adg.pbmbpt.
permutations
The permutations that generate equivalent diags.
Type: list
Returns: Vertex combinations that do not produce equivalent diags. Return type: (list) >>> vertices = [1, 3] >>> permutations = [{1: 1, 3: 3}, {1: 3, 3: 1}] >>> print(unique_vertex_combinations(vertices, permutations)) [(1, 3), (3,)]
-