Taking your magnesium on an empty stomach before bed can have a pleasant muscle - relaxing effect that makes it easier to move into and stay in deep sleep states. (besynchro.com)
Drinking alcohol can disrupt the structure and duration of sleep states, alter total sleep time, and affect the time required to fall asleep. (verywellmind.com)
The following paragraphs describe how these measurements are used to distinguish different sleep states and sleep stages. (pubs.niaaa.nih.gov)