How to use molecular's quaternions for orientation-dependent forces calculation with "hybrid sphere molecular" style?

Dear LAMMPSers,

I am going to use Lammps to calculate orientation-dependent forces on finite size rigid bodies with

Dear LAMMPSers,

I am going to use Lammps to calculate orientation-dependent forces on finite
size rigid bodies with

----------------------------------------------
atom_style hybrid sphere molecular
...
fix Rigids all rigid molecule
...
----------------------------------------------

Assuming the force coefficients of a specific shaped rigid body are
pre-calculated from different Euler angles (a_x, a_y, a_z), and the uniform
force field (electric/fluid field, etc ) orientation is fix at Z+ direction.
Since "fix rigid" does calculate the quaternion information for each rigid
body, therefore the force coefficient can be calculated like: coeff_force =
Func(field_direction, quat_rigid) via the pre-calculated data (interpolation
utilized).

My question is: how to use the per rigid/molecular quaternion information
"quat[ibody]" for
1) created a new fix for the orientation-dependent forces calculation

you can access internal data from other class instances via the
extract() function.
if a property is not listed, you can add it. body exists in
FixRigid::extract(), access to quat would need to be added.

and

2) if Lammps is called as static library for other program, how we can get
the quat[ibody] information?

same mechanism as above using lammps_extract_fix()

axel.