# How to Create a 2D Structure of Boron (Brophene) using ASE?

Unlike Graphene and MoS2, For borophene, I didn't find any inbuilt function in ASE. I have tried to make it, but i failed. So If anyone could help me, it will be great help.

Since brophene has graphene like structure,I have tried to make it like graphene, although I think it's wrong approach.

from ase.visualize import view
from ase import Atoms
from ase.build import hcp0001

#--------------------------------------------------------

slab = hcp0001('B',a=4.7, size=(5,8,1), vacuum=None, orthogonal=True)
view(slab)

#---------------------------------------------------------

cell = [[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]]
slab.set_cell(cell)
slab.pbc=True

#-------------------------------------

from gpaw import GPAW
calc = GPAW(xc='PBE')
slab.set_calculator(calc)

#--------------------------------------

opt = BFGS(slab,
trajectory='borophene.traj',
logfile='borophene.log')

#---------------------------------------

opt.run(fmax=0.05)


As you said, borophene has the same structure as graphene. Then you can first build a graphene structure in ASE, then change every atom to boron, and scale the lattice parameters to be that of a borophene. Here is the code (the lattice constant values might not be right so you need to double check that)

from ase.build import graphene
from ase.visualize import view

# Build a graphene monolayer
atoms = graphene()
a_borophene = 2.90
a_graphene = 2.46
scaling_factor = a_borophene / a_graphene
# Save the fractional coordinates
fracs = atoms.get_scaled_positions()
# Scale the unit cell x and y dimensions by the scaling factor
atoms.cell *= (scaling_factor, scaling_factor, 1)
# Scale the atomic coordinates
atoms.positions = fracs @ atoms.cell
# Change carbon atoms to boron
for atom in atoms:
atom.symbol = 'B'
# Center the structure in the z direction
atoms.center(vacuum=5., axis=2)
# Visualize
view(atoms)


And there you have it

You could define the formula for a graphene-like structure. For example, ase.build.graphene(formula='B2', a=2.46, thickness=0.0, size=(1, 1, 1), vacuum=None)