@cached<EOL><INDENT>def volume(self):<DEDENT>
active = self.active_inactive[<NUM_LIT:0>]<EOL>if len(active) == <NUM_LIT:0>:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT>elif len(active) == <NUM_LIT:1>:<EOL><INDENT>return np.linalg.norm(self.matrix[:, active[<NUM_LIT:0>]])<EOL><DEDENT>elif len(active) == <NUM_LIT:2>:<EOL><INDENT>return np.linalg.norm(np.cross(self.matrix[:, active[<NUM_LIT:0>]], self.matrix[:, active[<NUM_LIT:1>]]))<EOL><DEDENT>elif len(active) == <NUM_LIT:3>:<EOL><INDENT>return abs(np.linalg.det(self.matrix))<EOL><DEDENT>
The volume of the unit cell

           The actual definition of the volume depends on the number of active
           directions:

           * num_active == 0  --  always -1
           * num_active == 1  --  length of the cell vector
           * num_active == 2  --  surface of the parallelogram
           * num_active == 3  --  volume of the parallelepiped