+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+lorentzidx::lorentzidx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("lorentzidx constructor from archive_node", LOGLEVEL_CONSTRUCT);
+ n.find_bool("orthogonal_only", orthogonal_only);
+ if (orthogonal_only)
+ n.find_unsigned("pdim", dim_parallel_space);
+}
+
+/** Unarchive the object. */
+ex lorentzidx::unarchive(const archive_node &n, const lst &sym_lst)
+{
+ ex s = (new lorentzidx(n, sym_lst))->setflag(status_flags::dynallocated);
+
+ if (ex_to_lorentzidx(s).symbolic) {
+ // If lorentzidx is in sym_lst, return the existing lorentzidx
+ for (int i=0; i<sym_lst.nops(); i++) {
+ if (is_ex_of_type(sym_lst.op(i), lorentzidx) && (ex_to_lorentzidx(sym_lst.op(i)).name == ex_to_lorentzidx(s).name))
+ return sym_lst.op(i);
+ }
+ }
+ return s;
+}
+
+/** Archive the object. */
+void lorentzidx::archive(archive_node &n) const
+{
+ inherited::archive(n);
+ n.add_bool("orthogonal_only", orthogonal_only);
+ if (orthogonal_only)
+ n.add_unsigned("pdim", dim_parallel_space);
+}
+