PBMBPT Diagram

Routines and class for Projected Bogoliubov MBPT diagrams.

class adg.pbmbpt.ProjectedBmbptDiagram(graph, unique_id, tag, child_tag)[source]

Bases: BmbptFeynmanDiagram

Describes a PBMBPT diagram with its related properties.

Parameters
  • graph (NetworkX MultiDiGraph) – The graph of interest.

  • unique_id (int) – The unique number associated to the diagram.

  • tag (int) – Tag of the parent BMBPT diagram.

  • child_tag (int) – Identifier of the PBMBPT diagram within the children of the BMBPT diagram.

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.

attribute_qp_labels()[source]

Attribute the appropriate qp labels to the graph’s propagators.

property 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

The ascendingly sorted degrees of the graph vertices.

Type

tuple

diag_exp

The Goldstone expression associated to the diagram.

Type

str

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

The Feynman expression associated to the diagram.

Type

str

graph

The actual graph.

Type

NetworkX MultiDiGraph

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

bool

hf_type

The Hartree-Fock, non-Hartree-Fock or Hartree-Fock for the energy operator only character of the graph.

Type

str

io_degrees

The sorted version of unsort_io_degrees.

Type

tuple

max_degree

The maximal degree of a vertex in the graph.

Type

int

multiplicity_symmetry_factor()[source]

Return the symmetry factor associated with propagators multiplicity.

Returns

The symmetry factor associated with equivalent lines.

Return type

str

set_io_degrees()[source]

Attribute the correct in- and out-degrees to a PBMBPT diagram.

symmetry_factor()[source]

Return the overall symmetry factor of the diagram.

Returns

The combination of all symmetry factors.

Return type

str

tags

The tag numbers associated to a diagram.

Type

list

time_tag

The tag number associated to the diagram’s associated TSD.

Type

int

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

The tree or non-tree character of the associated TSD.

Type

bool

two_or_three_body

The 2 or 3-body characted of the vertices.

Type

int

unique_id

A unique number associated to the diagram.

Type

int

unsort_degrees

The degrees of the graph vertices

Type

tuple

unsort_io_degrees

The list of in- and out-degrees for each vertex of the graph, stored in a (in, out) tuple.

Type

tuple

vert_exp

The expression associated to the vertices.

Type

list

property 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.

Parameters

graph (Networkx MultiDiGraph) – The graph to be checked.

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.

Parameters
  • 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.

Parameters

iter_list (list) – A list of iterable objects.

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.

Parameters
  • edges (list) – The edges that can be modified.

  • permutations (list) – The permutation generating equivalent diagrams.

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.

Parameters
  • vertices (list) – Vertices that can be self-contracted.

  • permutations (list) – The permutations that generate equivalent diags.

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,)]