Quantum theory of magnetic octupole in periodic crystals and application to d-wave altermagnets | Synapse