CoCalc Public FilesPersonal / POW / POW Fall 2018 # 10 / check.htmlOpen with one click!
Author: Peter Francis
Views : 33
Compute Environment: Ubuntu 18.04 (Deprecated)
(File too big to render with math typesetting.)
check
In [3]:
count1 = 0
count2 = 0
for a in [-10..10]:
    a = -1*a
    A_1 =  matrix(QQ,[[a+0,a+1],[a+2,a+3]])
    A_2 =  matrix(QQ,[[a+0,a+1],[a+3,a+2]])
    A_3 =  matrix(QQ,[[a+0,a+2],[a+1,a+3]])
    A_4 =  matrix(QQ,[[a+0,a+2],[a+3,a+1]])
    A_5 =  matrix(QQ,[[a+0,a+3],[a+1,a+2]])
    A_6 =  matrix(QQ,[[a+0,a+3],[a+2,a+1]])
    A_7 =  matrix(QQ,[[a+1,a+2],[a+3,a+0]])
    A_8 =  matrix(QQ,[[a+1,a+2],[a+0,a+3]])
    A_9 =  matrix(QQ,[[a+1,a+3],[a+2,a+0]])
    A_10 = matrix(QQ,[[a+1,a+3],[a+0,a+2]])
    A_11 = matrix(QQ,[[a+1,a+0],[a+2,a+3]])
    A_12 = matrix(QQ,[[a+1,a+0],[a+3,a+2]])
    A_13 = matrix(QQ,[[a+2,a+0],[a+1,a+3]])
    A_14 = matrix(QQ,[[a+2,a+0],[a+3,a+1]])
    A_15 = matrix(QQ,[[a+2,a+1],[a+0,a+3]])
    A_16 = matrix(QQ,[[a+2,a+1],[a+3,a+0]])
    A_17 = matrix(QQ,[[a+2,a+3],[a+1,a+0]])
    A_18 = matrix(QQ,[[a+2,a+3],[a+0,a+1]])
    A_19 = matrix(QQ,[[a+3,a+0],[a+2,a+1]])
    A_20 = matrix(QQ,[[a+3,a+0],[a+1,a+2]])
    A_21 = matrix(QQ,[[a+3,a+1],[a+2,a+0]])
    A_22 = matrix(QQ,[[a+3,a+1],[a+0,a+2]])
    A_23 = matrix(QQ,[[a+3,a+2],[a+1,a+0]])
    A_24 = matrix(QQ,[[a+3,a+2],[a+0,a+1]])
    A = [A_1,A_2,A_3,A_4,A_5,A_6,A_7,A_8,A_9,A_10,A_11,A_12,A_13,A_14,A_15,A_16,A_17,A_18,A_19,A_20,A_21,A_22,A_23,A_24]

    for b in [-10..10]:
        b=b*-1
        B_1 =  matrix(QQ,[[b+0,b+1],[b+2,b+3]])
        B_2 =  matrix(QQ,[[b+0,b+1],[b+3,b+2]])
        B_3 =  matrix(QQ,[[b+0,b+2],[b+1,b+3]])
        B_4 =  matrix(QQ,[[b+0,b+2],[b+3,b+1]])
        B_5 =  matrix(QQ,[[b+0,b+3],[b+1,b+2]])
        B_6 =  matrix(QQ,[[b+0,b+3],[b+2,b+1]])
        B_7 =  matrix(QQ,[[b+1,b+2],[b+3,b+0]])
        B_8 =  matrix(QQ,[[b+1,b+2],[b+0,b+3]])
        B_9 =  matrix(QQ,[[b+1,b+3],[b+2,b+0]])
        B_10 = matrix(QQ,[[b+1,b+3],[b+0,b+2]])
        B_11 = matrix(QQ,[[b+1,b+0],[b+2,b+3]])
        B_12 = matrix(QQ,[[b+1,b+0],[b+3,b+2]])
        B_13 = matrix(QQ,[[b+2,b+0],[b+1,b+3]])
        B_14 = matrix(QQ,[[b+2,b+0],[b+3,b+1]])
        B_15 = matrix(QQ,[[b+2,b+1],[b+0,b+3]])
        B_16 = matrix(QQ,[[b+2,b+1],[b+3,b+0]])
        B_17 = matrix(QQ,[[b+2,b+3],[b+1,b+0]])
        B_18 = matrix(QQ,[[b+2,b+3],[b+0,b+1]])
        B_19 = matrix(QQ,[[b+3,b+0],[b+2,b+1]])
        B_20 = matrix(QQ,[[b+3,b+0],[b+1,b+2]])
        B_21 = matrix(QQ,[[b+3,b+1],[b+2,b+0]])
        B_22 = matrix(QQ,[[b+3,b+1],[b+0,b+2]])
        B_23 = matrix(QQ,[[b+3,b+2],[b+1,b+0]])
        B_24 = matrix(QQ,[[b+3,b+2],[b+0,b+1]])
        B=[B_1,B_2,B_3,B_4,B_5,B_6,B_7,B_8,B_9,B_10,B_11,B_12,B_13,B_14,B_15,B_16,B_17,B_18,B_19,B_20,B_21,B_22,B_23,B_24]

        for i in [0..23]:
            for j in [0..23]:
                C = A[i]*B[j]
                C_List = sorted([C.columns()[0][0], C.columns()[0][1], C.columns()[1][0], C.columns()[1][1]])
                count1 = count1 + 1
                if (C_List[0] +1 == C_List[1]) and (C_List[1] +1 == C_List[2]) and (C_List[2] +1 == C_List[3]):
                    count2 = count2 + 1
                    show(count2,'.........',A[i],B[j],'=',C)
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
WARNING: 1148 intermediate output messages were discarded.
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
Out[3]:
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-3-3d7c00553c1c> in <module>()
     64                 if (C_List[Integer(0)] +Integer(1) == C_List[Integer(1)]) and (C_List[Integer(1)] +Integer(1) == C_List[Integer(2)]) and (C_List[Integer(2)] +Integer(1) == C_List[Integer(3)]):
     65                     count2 = count2 + Integer(1)
---> 66                     show(count2,'.........',A[i],B[j],'=',C)

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/pretty_print.pyc in show(*args, **kwds)
    256         args[0].show()
    257         return
--> 258     pretty_print(*args, **kwds)

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/pretty_print.pyc in pretty_print(*args, **kwds)
    229             dm.display_immediately(*args, **kwds)
    230         else:
--> 231             SequencePrettyPrinter(*args, **kwds).pretty_print()
    232     finally:
    233         dm.preferences.text = old_preferences_text

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/pretty_print.pyc in pretty_print(self)
    159             kwds = dict(self.kwds)
    160             kwds['concatenate'] = True
--> 161         get_display_manager().display_immediately(args, **kwds)
    162 
    163 

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in display_immediately(self, obj, **rich_repr_kwds)
    833             1/2
    834         """
--> 835         plain_text, rich_output = self._rich_output_formatter(obj, rich_repr_kwds)
    836         self._backend.display_immediately(plain_text, rich_output)
    837 

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in _rich_output_formatter(self, obj, rich_repr_kwds)
    630                 plain_text = self._call_rich_repr(obj, rich_repr_kwds)
    631         if plain_text is None:
--> 632             plain_text = self._backend.plain_text_formatter(obj, **rich_repr_kwds)
    633         if rich_output is None:
    634             rich_output = self._preferred_text_formatter(

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_base.pyc in plain_text_formatter(self, obj, **kwds)
    323         if kwds.get('concatenate', False):
    324             plain_text = ' '.join(
--> 325                 self._apply_pretty_printer(SagePrettyPrinter, o) for o in obj)
    326         else:
    327             plain_text = self._apply_pretty_printer(SagePrettyPrinter, obj)

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_base.pyc in <genexpr>((o,))
    323         if kwds.get('concatenate', False):
    324             plain_text = ' '.join(
--> 325                 self._apply_pretty_printer(SagePrettyPrinter, o) for o in obj)
    326         else:
    327             plain_text = self._apply_pretty_printer(SagePrettyPrinter, obj)

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_base.pyc in _apply_pretty_printer(self, pretty_printer_class, obj)
    270         printer = pretty_printer_class(
    271             stream, self.max_width(), self.newline())
--> 272         printer.pretty(obj)
    273         printer.flush()
    274         return stream.getvalue()

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/display/pretty_print.pyc in pretty(self, obj)
    141             for representation in self.pretty_repr:
    142                 if self.DEBUG: print('Trying {0}'.format(representation))
--> 143                 ok = representation(obj, self, cycle)
    144                 if self.DEBUG: print('ok = {0}'.format(ok))
    145                 if ok not in [True, False]:

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/repl/display/fancy_repr.pyc in __call__(self, obj, p, cycle)
    270             # A user-provided repr. Find newlines and replace them with p.break_()
    271             try:
--> 272                 output = repr(obj)
    273             except Exception:
    274                 import sys, traceback

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix.__repr__ (build/cythonized/sage/matrix/matrix0.c:12058)()
   1708         """
   1709         if self._nrows < max_rows and self._ncols < max_cols:
-> 1710             return self.str()
   1711         if self.is_sparse():
   1712             s = 'sparse'

/ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix.str (build/cythonized/sage/matrix/matrix0.c:14189)()
   1955                 rep = rep_mapping.get(x)
   1956             else:
-> 1957                 rep = repr(x)
   1958             S.append(rep)
   1959 

src/cysignals/signals.pyx in cysignals.signals.python_check_interrupt()

src/cysignals/signals.pyx in cysignals.signals.sig_raise_exception()

KeyboardInterrupt: 
WARNING: 1148 intermediate output messages were discarded.
In [25]:
show(count1)
show(count2)
show(RR(count2/count1))
Out[25]:
Out[25]:
Out[25]:
In [0]:
 
;