<｜begin▁of▁sentence｜>### Instruction:
Given a graph with vertices labeled 'A', 'B', 'C', 'D' and edges between them forming a cycle with a diagonal ('A'-'B'-'C'-'D'-'A' and 'A'-'C'), how can you write its adjacency matrix to a text file using igraph's Graph.write_adjacency method? The vertices should be separated by a space, and each row of the matrix should be separated by a newline character. The file should be named 'adjacency_matrix.txt'.
### Response:
import igraph as ig

# Create a graph
vertices = ['A', 'B', 'C', 'D']
edges = [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)]
g = ig.Graph(edges=edges)
g.vs['label'] = vertices  # Assign labels to the vertices

# Write adjacency matrix to a file
filename = 'adjacency_matrix.txt'
sep = ' '
eol = '\n'
g.write_adjacency(filename, sep=sep, eol=eol)
<|EOT|>
