Пример #1
0
 def action_write_parameters(targets: List[str]):
     obj = [
         self.psi,
         self.operator,
         inaccurate_hash(self.momentum_operator.real),
         inaccurate_hash(self.momentum_operator.imag),
         self.wfn,
         self.output_file,
     ]
     with open(targets[0], "wb") as fptr:
         pickle.dump(obj, fptr, protocol=3)
Пример #2
0
        def action_write_parameters(targets: List[str]):
            obj = [
                self.name,
                self.specification.dofs,
                self.specification.grids,
                self.specification.coefficients,
                {},
                self.specification.table,
            ]
            for term in self.specification.terms:
                if isinstance(self.specification.terms[term], dict):
                    obj[4][term] = {
                        key: self.specification.terms[key]
                        for key in self.specification.terms
                    }
                    if "value" in obj[4][term]:
                        obj[4][term]["value"] = inaccurate_hash(
                            obj[4][term]["value"])
                else:
                    obj[4][term] = inaccurate_hash(
                        self.specification.terms[term])

            with open(targets[0], "wb") as fp:
                pickle.dump(obj, fp, protocol=3)
Пример #3
0
        def action_write_parameters(targets: List[str]):
            del targets

            obj = [
                self.name,
                self.specification.dofs,
                self.specification.coefficients,
                {},
                self.specification.table,
            ]
            for term in self.specification.terms:
                obj[3][term] = inaccurate_hash(self.specification.terms[term])

            with open(self.path_pickle, "wb") as fptr:
                pickle.dump(obj, fptr, protocol=3)
Пример #4
0
        def action_write_parameters(targets: list[str]):
            del targets
            obj = [self.dvrs, self.dofs_A]
            if self.basis_states is not None:
                obj.append(
                    {
                        dof: [
                            inaccurate_hash(state) for state in self.basis_states[dof]
                        ]
                        for dof in self.basis_states
                    },
                )
            else:
                obj.append(None)
            obj += [self.diagonalize, self.store_eigenvectors, self.diag_cleanup]

            with open(self.picklename, "wb") as fptr:
                pickle.dump(obj, fptr, protocol=3)
Пример #5
0
        def action_write_parameters(targets: list[str]):
            del targets

            example = self.func(*self.indices[0])

            obj = [
                self.name,
                self.psi,
                self.indices,
                example.dofs,
                example.coefficients,
                {
                    term: inaccurate_hash(example.terms[term])
                    for term in example.terms
                },
                example.table,
            ]

            with open(self.pickle, "wb") as fptr:
                pickle.dump(obj, fptr, protocol=3)