Esempio n. 1
0
 def setUp(self):
     self.gc_list = [
         OrdinaryGraphComplex.OrdinaryGC(v_range, l_range, even_edges,
                                         ['contract'])
         for even_edges in edges_types
     ]
     self.gc_list += [
         OrdinaryGraphComplex.OrdinaryGC(v_range, l_range, False,
                                         ['delete'])
     ]
Esempio n. 2
0
                graph_complex = OrdinaryGraphBiComplex.OrdinaryContractDeleteBiGC(
                    args.d, even_edges)
            else:
                raise ValueError('Ordinary graphs bicomplex: contract_delete')

        elif len(operators) > 0 and set(operators) <= {'contract', 'delete'}:
            if args.v is None:
                raise MissingArgumentError(
                    'specify -v: range for number of vertices')
            if args.l is None:
                raise MissingArgumentError(
                    'specify -l: range for number of loops')

            graph_complex = OrdinaryGraphComplex.OrdinaryGC(
                args.v,
                args.l,
                even_edges,
                operators,
                shift_loops_minus_vertices=args.shift)
        else:
            raise ValueError(
                'Differentials for ordinary graph complex: contract, delete')

    elif args.graph_type == 'hairy':
        if args.even_h:
            even_hairs = True
        elif args.odd_h:
            even_hairs = False
        else:
            raise MissingArgumentError('specify -even_h or -odd_h')

        if args.bicomplex is not None:
Esempio n. 3
0
            wwd[g6] += x * sgn
        else:
            wwd[g6] = x * sgn
    print(wwd)
    nonzeroflag = false
    for g6, x in wwd.items():
        if x != 0:
            print("Nonzero entry: ", g6, x)
            nonzeroflag = true
    if not nonzeroflag:
        print("all entries zero, i.e., success.")


# DSquareTestSingle(8, 6, False, plot_basis=True)

OGC = OrdinaryGraphComplex.OrdinaryGC(range(0, 17), range(0, 9), True,
                                      {'contract'})

OGC.build_basis(ignore_existing_files=True)
OGC.build_matrix(ignore_existing_files=True)
OGC.compute_rank(sage='integer', ignore_existing_files=True)
# OGC.square_zero_test()
# OGC.test_pairwise_anti_commutativity()
OGC.export_cohomology_dim_for_web()

# DDD = OrdinaryGraphComplex.ContractEdgesGO.generate_operator(
#     8, 6, False)

# w1 = DDD.operate_on(Graph("G@hU^_"))

# DDD2 = CHairyGraphComplex.ContractEdgesGO.generate_operator(
#     8, 6, 0, False)
Esempio n. 4
0
File: Test5.py Progetto: sibrun/GH
import unittest
import itertools
import logging
import Log
import TestGraphComplex
import OrdinaryGraphComplex
from sage.all import *

log_file = "Forested_Unittest.log"

if __name__ == '__main__':
    tt = OrdinaryGraphComplex.OrdinaryGC(range(0, 15), range(0, 8), False,
                                         {'contract'})
    tt.build_basis(ignore_existing_files=True, n_jobs=1, progress_bar=True)
    tt.build_matrix(ignore_existing_files=True, n_jobs=1, progress_bar=True)
Esempio n. 5
0
 def setUp(self):
     self.gc_list = [
         OrdinaryGraphComplex.OrdinaryGC(v_range, l_range, False,
                                         ['contract', 'delete'])
     ]