I want to know how the function “periodic” work in FEM space.

For example, If I define fespace Vh(Th, P1, periodic = [[1, x], [3, x], [2, y], [4, y]]) with mesh Th = square(2, 2). Is it equivalent to define fespace Vh(Th, P1), and just force the degrees of freedom on 1, 3 sides to be equal (so are 2,4 sides)？

Is there any error in the finite element interpolation in test2.edp? I tried to achieve the same result as test1.edp without using function “periodic”, but failed.