def __init__(self, xs, max_delta=5.0, max_index=5):
    self.xs1 = xs
    cbop_prim = self.xs1.change_of_basis_op_to_niggli_cell()
    self.xs2 = self.xs1.change_basis(cbop_prim)
    self.cbop =  rmpg.cb_op_as_rational(cbop_prim)
    self.xs_sl_list = symmetry_safe_sublattice_xs(self.xs2,1,max_index,max_delta)
    self.base_to_niggli_inv = rmpg.cb_op_as_rational( self.xs_sl_list.cb_op_to_niggli).inverse()

    self.ori_sg = rmpg.construct_rational_point_group( self.xs2.space_group() )
    self.ori_sg.change_basis( self.cbop.inverse() )
    self.derived_laws = []

    for nxs, mat, add_cb_op, mr in zip(self.xs_sl_list.xs_expand,
                                       self.xs_sl_list.matrices,
                                       self.xs_sl_list.add_to_niggli,
                                       self.xs_sl_list.metric_r_values):
      these_laws=  self.construct_twin_laws( nxs, mat, add_cb_op, mr )
      if these_laws is not None:
        this_info =   self.construct_twin_laws( nxs, mat, add_cb_op, mr )
        self.derived_laws.append( this_info )
Example #2
0
    def __init__(self, xs, max_delta=5.0, max_index=5):
        self.xs1 = xs
        cbop_prim = self.xs1.change_of_basis_op_to_niggli_cell()
        self.xs2 = self.xs1.change_basis(cbop_prim)
        self.cbop = rmpg.cb_op_as_rational(cbop_prim)
        self.xs_sl_list = symmetry_safe_sublattice_xs(self.xs2, 1, max_index,
                                                      max_delta)
        self.base_to_niggli_inv = rmpg.cb_op_as_rational(
            self.xs_sl_list.cb_op_to_niggli).inverse()

        self.ori_sg = rmpg.construct_rational_point_group(
            self.xs2.space_group())
        self.ori_sg.change_basis(self.cbop.inverse())
        self.derived_laws = []

        for nxs, mat, add_cb_op, mr in zip(self.xs_sl_list.xs_expand,
                                           self.xs_sl_list.matrices,
                                           self.xs_sl_list.add_to_niggli,
                                           self.xs_sl_list.metric_r_values):
            these_laws = self.construct_twin_laws(nxs, mat, add_cb_op, mr)
            if these_laws is not None:
                this_info = self.construct_twin_laws(nxs, mat, add_cb_op, mr)
                self.derived_laws.append(this_info)
  def construct_twin_laws(self, xs, mat, additional_cb_op, r, show=False):
    # get the new symmetry object
    # A.cb(nig).cb(mat).cb(add_to_niggli)
    tmp_sg = xs.reflection_intensity_symmetry(anomalous_flag = self.xs2.space_group().is_chiral() ).space_group()
    new_sg = rmpg.construct_rational_point_group( tmp_sg )
    tmp_cb_op = rmpg.cb_op_as_rational( additional_cb_op ).inverse()

    new_sg.change_basis( tmp_cb_op )
    new_sg.change_basis( mat.inverse() )
    new_sg.change_basis( self.base_to_niggli_inv )
    new_sg.change_basis( self.cbop.inverse() )

    these_twin_laws = rmpg.build_reticular_twin_laws(self.ori_sg,new_sg )
    if these_twin_laws is not None:
      tlinfo = ret_twin_law_info(these_twin_laws,mat,r,self.xs1,xs )
      return tlinfo
    else:
      return None
Example #4
0
    def construct_twin_laws(self, xs, mat, additional_cb_op, r, show=False):
        # get the new symmetry object
        # A.cb(nig).cb(mat).cb(add_to_niggli)
        tmp_sg = xs.reflection_intensity_symmetry(
            anomalous_flag=self.xs2.space_group().is_chiral()).space_group()
        new_sg = rmpg.construct_rational_point_group(tmp_sg)
        tmp_cb_op = rmpg.cb_op_as_rational(additional_cb_op).inverse()

        new_sg.change_basis(tmp_cb_op)
        new_sg.change_basis(mat.inverse())
        new_sg.change_basis(self.base_to_niggli_inv)
        new_sg.change_basis(self.cbop.inverse())

        these_twin_laws = rmpg.build_reticular_twin_laws(self.ori_sg, new_sg)
        if these_twin_laws is not None:
            tlinfo = ret_twin_law_info(these_twin_laws, mat, r, self.xs1, xs)
            return tlinfo
        else:
            return None