# VecSqrtAbs
Replaces each component of a vector by the square root of its magnitude. 
## Synopsis
```
#include "petscvec.h" 
PetscErrorCode VecSqrtAbs(Vec v)
```
Not collective


## Input Parameter

- ***v -*** The vector



## Output Parameter

- ***v -*** The vector square root




Note: The actual function is sqrt(|x_i|)


## See Also
 `VecLog()`, `VecExp()`, `VecReciprocal()`, `VecAbs()`


## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/vinv.c.html#VecSqrtAbs">src/vec/vec/utils/vinv.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/constrained/tutorials/tomographyADMM.c.html">src/tao/constrained/tutorials/tomographyADMM.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/tutorials/ex4.c.html">src/tao/tutorials/ex4.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/vinv.c)


[Index of all Vec routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
