当前位置: 首页>>代码示例>>Python>>正文


Python stringpict.prettyForm函数代码示例

本文整理汇总了Python中sympy.printing.pretty.stringpict.prettyForm函数的典型用法代码示例。如果您正苦于以下问题:Python prettyForm函数的具体用法?Python prettyForm怎么用?Python prettyForm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了prettyForm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _print_contents_pretty

 def _print_contents_pretty(self, printer, *args):
     pform = self._print_operator_name_pretty(printer, *args)
     label_pform = self._print_label_pretty(printer, *args)
     label_pform = prettyForm(
         *label_pform.parens(left='(', right=')')
     )
     pform = prettyForm(*pform.right((label_pform)))
     return pform
开发者ID:ALGHeArT,项目名称:sympy,代码行数:8,代码来源:operator.py

示例2: _pretty

 def _pretty(self, printer, *args):
     from sympy.printing.pretty.stringpict import prettyForm
     pform = printer._print(self.args[0], *args)
     if printer._use_unicode:
         pform = pform**prettyForm(u'\N{DAGGER}')
     else:
         pform = pform**prettyForm('+')
     return pform
开发者ID:asmeurer,项目名称:sympy,代码行数:8,代码来源:complexes.py

示例3: _pretty

 def _pretty(self, printer, *args):
     pform_exp = printer._print(self.exp, *args)
     if printer._use_unicode:
         pform_exp = prettyForm(*pform_exp.left(prettyForm(u'\u2a02')))
     else:
         pform_exp = prettyForm(*pform_exp.left(prettyForm('x')))
     pform_base = printer._print(self.base, *args)
     return pform_base**pform_exp
开发者ID:jenshnielsen,项目名称:sympy,代码行数:8,代码来源:hilbert.py

示例4: _print_contents_pretty

 def _print_contents_pretty(self, printer, *args):
     pform = self._print_label_pretty(printer, *args)
     pform = prettyForm(*pform.left((self.lbracket_pretty)))
     pform = prettyForm(*pform.right((';')))
     nextpform = self._print_time_pretty(printer, *args)
     pform = prettyForm(*pform.right((nextpform)))
     pform = prettyForm(*pform.right((self.rbracket_pretty)))
     return pform
开发者ID:ALGHeArT,项目名称:sympy,代码行数:8,代码来源:state.py

示例5: _pretty

 def _pretty(self, printer, *args):
     pform = printer._print(self.args[0], *args)
     pform = prettyForm(*pform.right((prettyForm(','))))
     pform = prettyForm(*pform.right((printer._print(self.args[1], *args))))
     a = stringPict(u'\u03b4')
     b = pform
     top = stringPict(*b.left(' '*a.width()))
     bot = stringPict(*a.right(' '*b.width()))
     return prettyForm(binding=prettyForm.POW, *bot.below(top))
开发者ID:ArchKaine,项目名称:sympy,代码行数:9,代码来源:kronecker.py

示例6: _pretty

 def _pretty(self, printer, *args):
     from sympy.printing.pretty.stringpict import prettyForm
     # Get brackets
     pform = self._print_contents_pretty(printer, *args)
     lbracket, rbracket = self._pretty_brackets(pform.height(), printer._use_unicode)
     # Put together state
     pform = prettyForm(*pform.left(lbracket))
     pform = prettyForm(*pform.right(rbracket))
     return pform
开发者ID:BDGLunde,项目名称:sympy,代码行数:9,代码来源:state.py

示例7: _print_contents_pretty

 def _print_contents_pretty(self, printer, *args):
     if len(self.label) == 1:
         return self._print_label_pretty(printer, *args)
     else:
         pform = self._print_operator_name_pretty(printer, *args)
         label_pform = self._print_label_pretty(printer, *args)
         label_pform = prettyForm(*label_pform.parens(left="(", right=")"))
         pform = prettyForm(*pform.right((label_pform)))
         return pform
开发者ID:rouxinol,项目名称:sympsi,代码行数:9,代码来源:operator.py

示例8: _pretty

    def _pretty(self, printer, *args):
        from sympy.printing.pretty.stringpict import prettyForm

        pform = printer._print(self.args[0], *args)
        if printer._use_unicode:
            pform = pform ** prettyForm(u("\u2020"))
        else:
            pform = pform ** prettyForm("+")
        return pform
开发者ID:Bercio,项目名称:sympy,代码行数:9,代码来源:complexes.py

示例9: _print_Poly

    def _print_Poly(self, poly):
        expr = poly.as_expr()
        gens = list(poly.gens)
        domain = poly.get_domain()

        pform_head = prettyForm('Poly')
        pform_tail = self._print_seq([expr] + gens + [domain], '(', ')')

        pform = prettyForm(*pform_head.right(pform_tail))
        return pform
开发者ID:asmeurer,项目名称:scipy-2011-tutorial,代码行数:10,代码来源:pretty_poly.py

示例10: _pretty

 def _pretty(self, printer, *args):
     length = len(self.args)
     pform = printer._print("", *args)
     for i in range(length):
         next_pform = printer._print(self.args[i], *args)
         if isinstance(self.args[i], (Add, Mul)):
             next_pform = prettyForm(*next_pform.parens(left="(", right=")"))
         pform = prettyForm(*pform.right(next_pform))
         if i != length - 1:
             pform = prettyForm(*pform.right(u"\u2a02" + u" "))
     return pform
开发者ID:parleur,项目名称:sympy,代码行数:11,代码来源:tensorproduct.py

示例11: _pretty

 def _pretty(self, printer, *args):
     length = len(self.args)
     pform = printer._print('', *args)
     for i in range(length):
         next_pform = printer._print(self.args[i], *args)
         if isinstance(self.args[i], (Add, Mul)):
             next_pform = prettyForm(
                 *next_pform.parens(left='(', right=')')
             )
         pform = prettyForm(*pform.right(next_pform))
         if i != length-1:
             pform = prettyForm(*pform.right(u'\u2a02' + u' '))
     return pform
开发者ID:101man,项目名称:sympy,代码行数:13,代码来源:tensorproduct.py

示例12: _pretty

 def _pretty(self, printer, *args):
     length = len(self.args)
     pform = printer._print('', *args)
     for i in range(length):
         next_pform = printer._print(self.args[i], *args)
         if isinstance(self.args[i], (DirectSumHilbertSpace,
                       TensorProductHilbertSpace)):
             next_pform = prettyForm(
                 *next_pform.parens(left='(', right=')')
             )
         pform = prettyForm(*pform.right(next_pform))
         if i != length-1:
             pform = prettyForm(*pform.right(u' ' + u'\u2295' + u' '))
     return pform
开发者ID:ArchKaine,项目名称:sympy,代码行数:14,代码来源:hilbert.py

示例13: _pretty

 def _pretty(self, printer, *args):
     # Print state contents
     bra = self.bra._print_contents_pretty(printer, *args)
     ket = self.ket._print_contents_pretty(printer, *args)
     # Print brackets
     height = max(bra.height(), ket.height())
     use_unicode = printer._use_unicode
     lbracket, _ = self.bra._pretty_brackets(height, use_unicode)
     cbracket, rbracket = self.ket._pretty_brackets(height, use_unicode)
     # Build innerproduct
     pform = prettyForm(*bra.left(lbracket))
     pform = prettyForm(*pform.right(cbracket))
     pform = prettyForm(*pform.right(ket))
     pform = prettyForm(*pform.right(rbracket))
     return pform
开发者ID:A-turing-machine,项目名称:sympy,代码行数:15,代码来源:innerproduct.py

示例14: _print_contents_pretty

 def _print_contents_pretty(self, printer, *args):
     from sympy.printing.pretty.stringpict import prettyForm
     pform = printer._print(self.args[0], *args)
     if self.is_annihilation:
         return pform
     else:
         return pform**prettyForm(u('\u2020'))
开发者ID:B-Rich,项目名称:sympy,代码行数:7,代码来源:fermion.py

示例15: _pretty

 def _pretty(self, printer, *args):
     controls = self._print_sequence_pretty(self.controls, ',', printer, *args)
     gate = printer._print(self.gate)
     gate_name = stringPict(unicode(self.gate_name))
     first = self._print_subscript_pretty(gate_name, controls)
     gate = self._print_parens_pretty(gate)
     final = prettyForm(*first.right((gate)))
     return final
开发者ID:yangle,项目名称:sympy,代码行数:8,代码来源:gate.py


注:本文中的sympy.printing.pretty.stringpict.prettyForm函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。